Use the 'link' field to get a link from feeds.

This commit is contained in:
Nelson Elhage 2010-01-03 11:25:21 -05:00
parent 8c882ab61f
commit 24183af125
1 changed files with 1 additions and 11 deletions

View File

@ -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)