aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/lib/crawler.py
blob: 1d7fca718526a8e838f2e7ebcc94676c3751ffc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
import feedparser
import dateutil.parser.parse


def get_feed_content(feed):
    etag = feed.get('etag', None)
    last_modified = None
    if feed.get('last_modified'):
        last_modified = dateutil.parser.parse(feed['last_modified'])\
                                    .strftime('%a, %d %b %Y %H:%M:%S %Z')
    return feedparser.parse(feed['link'], etag=etag, modified=last_modified)
bgstack15