diff options
Diffstat (limited to 'fetch.py')
-rw-r--r-- | fetch.py | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -9,6 +9,7 @@ import sys from pyaggr3g470r import crawler +from pyaggr3g470r.models import User if __name__ == "__main__": # Point of entry in execution mode @@ -16,5 +17,14 @@ if __name__ == "__main__": feed_id = int(sys.argv[2]) except: feed_id = None - feed_getter = crawler.FeedGetter(sys.argv[1]) - feed_getter.retrieve_feed(feed_id) + + users = [] + try: + users = User.query.filter(User.email == sys.argv[1]).all() + except: + users = User.query.all() + + for user in users: + print "Fetching articles for", user.nickname + feed_getter = crawler.FeedGetter(user.email) + feed_getter.retrieve_feed(feed_id) |