import yaml
import feedparser
import datetime
+import sys
from dateutil.parser import parse
import dateutil.tz as tz
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
- return None
+ return post.link
def parse_feeds(weeks, uri):
feed = feedparser.parse(uri)
+ if not feed.entries:
+ print >>sys.stderr, "WARN: no entries for ", uri
for post in feed.entries:
date = parse_published(get_date(post))