diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-05-29 11:07:02 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-05-29 11:07:02 +0200 |
commit | 692f585dd7c5cbccd3aedd27b63950e7f287aeba (patch) | |
tree | fd7ee84585a910f53de885d60eec4575055cb0fc | |
parent | Updated README. (diff) | |
download | newspipe-692f585dd7c5cbccd3aedd27b63950e7f287aeba.tar.gz newspipe-692f585dd7c5cbccd3aedd27b63950e7f287aeba.tar.bz2 newspipe-692f585dd7c5cbccd3aedd27b63950e7f287aeba.zip |
fetch.py can now retrieved articles for all user (when no arguments are given).
-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) |