Skip to content

Commit 7c72d5b

Browse files
committed
Merge branch 'release-v0.6.0-beta'
2 parents 4516694 + e65a714 commit 7c72d5b

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ the commands.
8989
`invoke start` (possibly with `nohup`)
9090

9191
## Changelog
92+
### v0.6.0-beta
93+
* Update subreddit monitoring implementation (fixes #25)
9294
### v0.5.0-beta
9395
* Fix program crash when exception occurs (@yleong PR #22)
9496
* Fix exception in handling Ricemedia links (@yleong PR #20)

config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
RUN_EVERY = 2
1212

1313
BOT = {
14-
"VERSION": "0.5.0-beta",
14+
"VERSION": "0.6.0-beta",
1515
"REPO_LINK": "https://github.com/fterh/sneakpeek",
1616
"CONTRIBUTE_LINK": "https://github.com/fterh/sneakpeek"
1717
}

main.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,15 @@ def start():
2222
try:
2323
scan(reddit.subreddit(config.SUBREDDIT))
2424
except Exception as e:
25-
print("Exception occurred while scanning")
25+
# This should never happen,
26+
# because it breaks the infinite subreddit monitoring
27+
# provided by subreddit.stream.submissions()
28+
print("Exception occurred while scanning. This should never happen!")
2629
traceback.print_exc()
2730

2831

2932
DatabaseManager.disconnect()
3033

3134

32-
schedule.every(config.RUN_EVERY).minutes.do(start)
33-
34-
3535
if __name__ == "__main__":
3636
start()
37-
while True:
38-
schedule.run_pending()
39-
print("Sleeping")
40-
time.sleep(1)

scan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def scan(subreddit):
1111
"""Scan a Subreddit for new submissions."""
1212
print("Starting scan")
1313

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

1717
does_qualify = qualify(submission)

0 commit comments

Comments
 (0)