Skip to content

Commit

Permalink
Merge branch 'release-v0.6.0-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
fterh committed May 1, 2019
2 parents 4516694 + e65a714 commit 7c72d5b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ the commands.
`invoke start` (possibly with `nohup`)

## Changelog
### v0.6.0-beta
* Update subreddit monitoring implementation (fixes #25)
### v0.5.0-beta
* Fix program crash when exception occurs (@yleong PR #22)
* Fix exception in handling Ricemedia links (@yleong PR #20)
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
RUN_EVERY = 2

BOT = {
"VERSION": "0.5.0-beta",
"VERSION": "0.6.0-beta",
"REPO_LINK": "https://github.com/fterh/sneakpeek",
"CONTRIBUTE_LINK": "https://github.com/fterh/sneakpeek"
}
Expand Down
12 changes: 4 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@ def start():
try:
scan(reddit.subreddit(config.SUBREDDIT))
except Exception as e:
print("Exception occurred while scanning")
# This should never happen,
# because it breaks the infinite subreddit monitoring
# provided by subreddit.stream.submissions()
print("Exception occurred while scanning. This should never happen!")
traceback.print_exc()


DatabaseManager.disconnect()


schedule.every(config.RUN_EVERY).minutes.do(start)


if __name__ == "__main__":
start()
while True:
schedule.run_pending()
print("Sleeping")
time.sleep(1)
2 changes: 1 addition & 1 deletion scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def scan(subreddit):
"""Scan a Subreddit for new submissions."""
print("Starting scan")

for submission in subreddit.new(limit=config.LIMIT):
for submission in subreddit.stream.submissions():
print("Operating on submission ID: " + submission.id)

does_qualify = qualify(submission)
Expand Down

0 comments on commit 7c72d5b

Please sign in to comment.