summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/rss.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-11-29 14:57:11 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-11-29 14:57:11 +0000
commit0328e248243c091efbfef06d6b4370ae08107cbe (patch)
tree2d9deae0cbc15665cafce7788ca6fd3078a2836f /data/rbot/plugins/rss.rb
parent0a8d35d747b1efab52608ea0705731db06012599 (diff)
rss plugin: calculate item_uid_for_bot() on Atom feeds without breaking
Diffstat (limited to 'data/rbot/plugins/rss.rb')
-rw-r--r--data/rbot/plugins/rss.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index 2689b3c3..c9231dad 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -24,8 +24,13 @@ module ::RSS
#
def RSS.item_uid_for_bot(item, opts={})
options = { :show_updated => true}.merge(opts)
- desc = options[:show_updated] ? item.description : nil
- [item.title, item.link, desc].hash
+ desc = nil
+ if options[:show_updated]
+ desc = item.content.content rescue item.description rescue nil
+ end
+ [(item.title.content rescue item.title rescue nil),
+ (item.link.href rescue item.link),
+ desc].hash
end
# Add support for Slashdot namespace in RDF. The code is just an adaptation