]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
rss plugin: fix watcher for empty feed
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 26 Jan 2009 00:05:59 +0000 (01:05 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 26 Jan 2009 00:51:35 +0000 (01:51 +0100)
data/rbot/plugins/rss.rb

index 387546ec32cf7a4c03d731601620bd8383b16810..f80236f08eef79d8cca4911df5e381f465f2a622 100644 (file)
@@ -883,14 +883,12 @@ class RSSFeedsPlugin < Plugin
             debug "xml for #{feed} didn't change"
             failures -= 1 if failures > 0
           else
-            if not feed.items
-              debug "no previous items in feed #{feed}"
-              parseRss(feed)
-              failures -= 1 if failures > 0
-            else
-              # This one is used for debugging
-              otxt = []
+            # This one is used for debugging
+            otxt = []
 
+            if feed.items.nil?
+              oids = []
+            else
               # These are used for checking new items vs old ones
               oids = Set.new feed.items.map { |item|
                 uid = make_uid item
@@ -899,6 +897,7 @@ class RSSFeedsPlugin < Plugin
                 debug [uid, otxt.last].inspect
                 uid
               }
+            end
 
               nitems = parseRss(feed)
               if nitems.nil?
@@ -938,7 +937,6 @@ class RSSFeedsPlugin < Plugin
                   debug "No new items found in #{feed}"
                 end
               end
-            end
           end
         end
       rescue Exception => e