Improve logging, sends tweets to nitter.net

This commit is contained in:
2022-03-05 23:48:46 +00:00
parent a693ea5342
commit a25457254f
7 changed files with 33 additions and 11 deletions

View File

@@ -61,11 +61,15 @@ def comment_count(i):
def story(ref):
r = api(API_ITEM, ref)
if not r: return False
if not r:
logging.info('Bad Hackernews API response.')
return False
if 'deleted' in r:
logging.info('Story was deleted.')
return False
elif r.get('type', '') != 'story':
logging.info('Type "{}" is not "story".'.format(r.get('type', '')))
return False
s = {}