From 8797fa565f88d1843011150d95ff6df6e1fefb41 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 26 Jan 2009 01:05:59 +0100 Subject: rss plugin: fix watcher for empty feed --- data/rbot/plugins/rss.rb | 14 ++++++-------- 1 file 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 -- cgit v1.2.3