From c31697b2d75aa46df9163ebce92ee68fd0f9ce7f Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 30 Jul 2008 20:29:32 +0200 Subject: rss plugin: check for unhandled Atom feeds (old Ruby/RSS library) --- data/rbot/plugins/rss.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'data') diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 77d897ca..a1bec30f 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -1121,7 +1121,12 @@ class RSSFeedsPlugin < Plugin end items = [] if rss.nil? - report_problem("#{feed} does not include RSS 1.0 or 0.9x/2.0", nil, m) + if xml.match(/xmlns\s*=\s*(['"])http:\/\/www.w3.org\/2005\/Atom\1/) and not defined?(RSS::Atom) + report_problem("#{feed.handle} @ #{feed.url} looks like an Atom feed, but your Ruby/RSS library doesn't seem to support it. Consider getting the latest version from http://raa.ruby-lang.org/project/rss/", nil, m) + else + report_problem("#{feed.handle} @ #{feed.url} doesn't seem to contain an RSS or Atom feed I can read", nil, m) + end + return nil else begin rss.output_encoding = 'UTF-8' -- cgit v1.2.3