Fix tildes comments parsing bug

This commit is contained in:
2019-08-25 07:46:22 +00:00
parent 2b1a352917
commit cf9e197e6c
2 changed files with 10 additions and 3 deletions

View File

@@ -29,6 +29,8 @@ def get_article(url):
def update_story(story):
res = {}
logging.info('Updating story ' + str(story['ref']))
if story['source'] == 'hackernews':
res = hackernews.story(story['ref'])
elif story['source'] == 'reddit':
@@ -42,6 +44,7 @@ def update_story(story):
story.update(res)
if story.get('url', '') and not story.get('text', ''):
if not story['url'].endswith('.pdf'):
logging.info('Getting article ' + story['url'])
story['text'] = get_article(story['url'])
else:
story['text'] = '<p>Unsupported article type.</p>'