diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-01-26 01:05:59 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-01-26 01:51:35 +0100 |
commit | 8797fa565f88d1843011150d95ff6df6e1fefb41 (patch) | |
tree | 96406142dc46180fe7b2f16f5e004ad2a908493f | |
parent | daf0eb2988d71f347b236ba77e43c51735ec2d3f (diff) |
rss plugin: fix watcher for empty feed
-rw-r--r-- | data/rbot/plugins/rss.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 387546ec..f80236f0 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -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 |