summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/rss.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-11 11:35:59 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-11 11:35:59 +0100
commit6f1866b4e78ccacd21bd24be2a714f3dbac58af3 (patch)
tree0b4ca46d6f2685b6c198b649ee7a13101929f623 /data/rbot/plugins/rss.rb
parent71fc5469f228c7be8f140dcec6726a48c0ced595 (diff)
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.
Diffstat (limited to 'data/rbot/plugins/rss.rb')
-rw-r--r--data/rbot/plugins/rss.rb4
1 files changed, 3 insertions, 1 deletions
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)