mirror of
https://github.com/sjlongland/tornado-news.git
synced 2025-09-13 10:03:14 +10:00
Fix handling of 'content'
This commit is contained in:
parent
10f2c56945
commit
16ad2d14e1
@ -69,12 +69,18 @@ class FeedEntry(object):
|
||||
Parse the feedparser-generated entry dict and return a FeedEntry
|
||||
object from it.
|
||||
"""
|
||||
if 'content' in entry:
|
||||
html_content = filter(lambda c : 'html' in c['type'], entry['content'])
|
||||
content = ''.join([c['value'] for c in html_content])
|
||||
else:
|
||||
content = entry['summary']
|
||||
|
||||
return cls(
|
||||
source, entry['id'], entry['link'], entry['title'],
|
||||
entry.get('author') or 'Anonymous',
|
||||
timegm(entry.get('updated_parsed') or \
|
||||
entry['published_parsed']),
|
||||
entry.get('content') or entry['summary'])
|
||||
content)
|
||||
|
||||
@property
|
||||
def raw(self):
|
||||
|
Loading…
Reference in New Issue
Block a user