Archive WSJ articles first, catch KeyboardInterrupt

This commit is contained in:
2019-10-15 21:03:47 +00:00
parent 9c4766a928
commit 810e8c5ead
5 changed files with 26 additions and 11 deletions

View File

@@ -24,6 +24,8 @@ reddit = praw.Reddit('bot')
def feed():
try:
return [x.id for x in reddit.subreddit(SUBREDDITS).hot()]
except KeyboardInterrupt:
raise
except PRAWException as e:
logging.error('Problem hitting reddit API: {}'.format(str(e)))
return []
@@ -70,6 +72,8 @@ def story(ref):
return s
except KeyboardInterrupt:
raise
except PRAWException as e:
logging.error('Problem hitting reddit API: {}'.format(str(e)))
return False