aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/feedgetter.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-01-12 10:59:35 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-01-12 10:59:35 +0100
commit6058ac1fc751fcdacd87096d2e491f5437b3265c (patch)
tree4840a5a738bcc2c7a7099be1713edf84545db02a /pyaggr3g470r/feedgetter.py
parentKeep the MongoDB database and Whoosh index synchronized. (diff)
downloadnewspipe-6058ac1fc751fcdacd87096d2e491f5437b3265c.tar.gz
newspipe-6058ac1fc751fcdacd87096d2e491f5437b3265c.tar.bz2
newspipe-6058ac1fc751fcdacd87096d2e491f5437b3265c.zip
It is now possible to feth only one feed.
Diffstat (limited to 'pyaggr3g470r/feedgetter.py')
-rw-r--r--pyaggr3g470r/feedgetter.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py
index abfa7994..8e1a2e58 100644
--- a/pyaggr3g470r/feedgetter.py
+++ b/pyaggr3g470r/feedgetter.py
@@ -69,11 +69,15 @@ class FeedGetter(object):
feedparser.USER_AGENT = conf.USER_AGENT
self.user = models.User.objects(email=email).first()
- def retrieve_feed(self):
+ def retrieve_feed(self, feed_id=None):
"""
Parse the file 'feeds.lst' and launch a thread for each RSS feed.
"""
- for current_feed in [feed for feed in self.user.feeds if feed.enabled]:
+ feeds = [feed for feed in self.user.feeds if feed.enabled]
+ if feed_id != None:
+ feeds = [feed for feed in feeds if str(feed.oid) == feed_id]
+ print len(feeds)
+ for current_feed in feeds:
try:
# launch a new thread for the RSS feed
thread = threading.Thread(None, self.process, \
bgstack15