aboutsummaryrefslogtreecommitdiff
path: root/fetch.py
diff options
context:
space:
mode:
Diffstat (limited to 'fetch.py')
-rw-r--r--fetch.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/fetch.py b/fetch.py
index e65fc1b1..38d1ba2f 100644
--- a/fetch.py
+++ b/fetch.py
@@ -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)
bgstack15