view feedupdate-main.py @ 47:a8442c3487b5

add an option to Feed that allows loading an entry's link right away instead of displaying a feed's summary
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sun, 16 May 2010 08:13:07 +0200
parents aaec263f07ca
children d21f5025034d
line wrap: on
line source

#!/usr/bin/env python

import Database
from Feed import Feed
import FeedUpdater
import logging
import util

logger = logging.getLogger("feedupdater")

def listFeeds(session):
    allFeeds = session.query(Feed)
    for feed in allFeeds:
        logger.info("feed: " + feed.name)
        for entry in feed.entries:
            print entry.title

if __name__ == "__main__":
    util.configureLogging()
    session = Database.createSession()
    
    #util.loadFeeds(session)
    #util.forceUpdateAllFeeds(session)
    #listFeeds(session)
    FeedUpdater.updateAllFeeds(session)
    
    session.close()