Use the 'link' field to get a link from feeds.
This commit is contained in:
parent
8c882ab61f
commit
24183af125
|
@ -21,17 +21,7 @@ def get_date(post):
|
|||
return post.updated
|
||||
|
||||
def get_link(post):
|
||||
if 'links' in post:
|
||||
links = dict((l.rel, l) for l in post.links if 'html' in l.type)
|
||||
if 'self' in links:
|
||||
return links['self'].href
|
||||
elif 'alternate' in links:
|
||||
return links['alternate'].href
|
||||
if 'href' in post:
|
||||
return post.href
|
||||
if 'link' in post:
|
||||
return post.link
|
||||
return None
|
||||
return post.link
|
||||
|
||||
def parse_feeds(weeks, uri):
|
||||
feed = feedparser.parse(uri)
|
||||
|
|
Loading…
Reference in New Issue