diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-01-11 11:35:59 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-01-11 11:35:59 +0100 |
commit | 6f1866b4e78ccacd21bd24be2a714f3dbac58af3 (patch) | |
tree | 0b4ca46d6f2685b6c198b649ee7a13101929f623 /data | |
parent | 71fc5469f228c7be8f140dcec6726a48c0ced595 (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')
-rw-r--r-- | data/rbot/plugins/rss.rb | 4 |
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) |