Esempio n. 1
0
def fetch_old_entries(feed):
    # example url: http://www.google.com/reader/public/atom/feed/http://feeds.feedburner.com/thesimpledollar?n=1000
    feed_url = 'http://feeds.feedburner.com/thesimpledollar'
    google_url = 'http://www.google.com/reader/public/atom/feed/' + sanitize_url(feed_url) + '?n=' + str(max_entries)

    # print "Fetching feed from", feed_url, "..."
    f = feedparser.parse(google_url)
    # print "Fetched", len(f.entries), "entries of", f.feed.title

    # print "Creating new feed..."
    for i in f.entries:
        e = Entry(title=i.title, link=i.link, description=i.description,   date=i.updated_parsed)
        e.feed = feed
        e.save()