summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/rss.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-11 15:17:02 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-11 15:20:34 +0100
commit450ab5c9615481acd9cfd5ac1cb24810460bd382 (patch)
tree6a674fa065e274854964aadd7df62fcc226c6833 /data/rbot/plugins/rss.rb
parent6f1866b4e78ccacd21bd24be2a714f3dbac58af3 (diff)
rss: obviously, the precending patch wasn't enough
Proper support for a 'modified' element actually requires its model to be defined and added to the RSS Atom namespace.
Diffstat (limited to 'data/rbot/plugins/rss.rb')
-rw-r--r--data/rbot/plugins/rss.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index 03e54140..6b163619 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -151,6 +151,28 @@ module ::RSS
SlashModel::ELEMENTS.collect! {|name| "#{SLASH_PREFIX}_#{name}"}
end
+ if self.const_defined? :Atom
+ # There are improper Atom feeds around that use the non-standard
+ # 'modified' element instead of the correct 'updated' one. Let's
+ # support it too.
+ module Atom
+ class Feed
+ class Modified < RSS::Element
+ include CommonModel
+ include DateConstruct
+ end
+ __send__("install_have_child_element",
+ "modified", URI, nil, "modified", :content)
+
+ class Entry
+ Modified = Feed::Modified
+ __send__("install_have_child_element",
+ "modified", URI, nil, "modified", :content)
+ end
+ end
+ end
+ end
+
class Element
class << self
def def_bang(name, chain)