From 6f1866b4e78ccacd21bd24be2a714f3dbac58af3 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 11 Jan 2011 11:35:59 +0100 Subject: [PATCH] rss: updated can be nil An Atom item can reply to updated even though its value is nil, so check for it actually being valued instead. Also, some malformed Atom feeds use the nonstandard 'modified' element instead, so check for that too. --- data/rbot/plugins/rss.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index eb3fa5f8..03e54140 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -1079,8 +1079,10 @@ class RSSFeedsPlugin < Plugin date = \ if opts[:date] - if item.respond_to?(:updated) + if item.respond_to?(:updated) and item.updated make_date(item.updated.content) + elsif item.respond_to?(:modified) and item.modified + make_date(item.modified.content) elsif item.respond_to?(:source) and item.source.respond_to?(:updated) make_date(item.source.updated.content) elsif item.respond_to?(:pubDate) -- 2.39.2