aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlas Oliva <blasoliva@gmail.com>2015-01-20 23:26:03 -0300
committerBlas Oliva <blasoliva@gmail.com>2015-01-20 23:26:03 -0300
commitf6b6e133d17dae3ec148d618b5ef9fc90b2b0dda (patch)
treee75f9bf37a1ace90506215d13e2e8260a206ebba
parent5d4383e4efbe24793392d28aa585baa1017d8362 (diff)
downloadreebot-f6b6e133d17dae3ec148d618b5ef9fc90b2b0dda.tar.gz
reebot-f6b6e133d17dae3ec148d618b5ef9fc90b2b0dda.zip
more little things
-rwxr-xr-xrbot.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/rbot.py b/rbot.py
index 836cdd2..7b05907 100755
--- a/rbot.py
+++ b/rbot.py
@@ -97,7 +97,7 @@ class rBot:
97 self.sendmessage( source, messages['welcome'] ) 97 self.sendmessage( source, messages['welcome'] )
98 98
99 def feed_refresh(self): 99 def feed_refresh(self):
100 """ Read feeds and sends them to the channel """ 100 """ Read feeds and sends the news to the channel """
101 101
102 msgqueue = [] 102 msgqueue = []
103 103
@@ -108,17 +108,17 @@ class rBot:
108 for feed in feed_list: 108 for feed in feed_list:
109 feeds = feedparser.parse( feed['url'] ) 109 feeds = feedparser.parse( feed['url'] )
110 110
111 # Loop over feeds entries 111 # Loop over entries
112 for entry in feeds.entries: 112 for entry in feeds.entries:
113 if self.db.log.find_one( { "url" : entry.link } ) is None: 113 if self.db.log.find_one( { "url" : entry.link } ) is None:
114 msgqueue.append( feed['name'] 114 msgqueue.append( feed['name']
115 + " | " + feeds.feed.title 115 + " | " + feeds.feed.title
116 + " > " + entry.title 116 + " > " + entry.title
117 + " : " + entry.link ) 117 + " : " + entry.link )
118 # Update feeds log in the database 118 # Update log in the database
119 self.db.log.insert( { "url" : entry.link } ) 119 self.db.log.insert( { "url" : entry.link } )
120 120
121 # Send newer feeds to the channel 121 # Send newer entries to the channel
122 while len( msgqueue ) > 0: 122 while len( msgqueue ) > 0:
123 msgq = msgqueue.pop() 123 msgq = msgqueue.pop()
124 for channel in channels_list: 124 for channel in channels_list: