summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-07-30 20:29:32 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-07-30 20:44:36 +0200
commitc31697b2d75aa46df9163ebce92ee68fd0f9ce7f (patch)
treee7a597434ce0b6ee09a92ce8c3f69db002fa1c67
parent2b07807fbed45fdeb6ca4f0e22f6fe64dd8bd339 (diff)
rss plugin: check for unhandled Atom feeds (old Ruby/RSS library)
-rw-r--r--data/rbot/plugins/rss.rb7
1 files changed, 6 insertions, 1 deletions
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'