From 1107570cb696e4d9f870da00282233b60b8a00ca Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 14 Apr 2007 08:41:45 +0000 Subject: rss plugin: fix bugs with category retrieval and author display --- data/rbot/plugins/rss.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 22b56295..e0d4df01 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -16,8 +16,6 @@ require 'rss' -# Add support for Slashdot namespace in RDF. The code is just an adaptation of -# the DublinCore code. module ::RSS # Make an 'unique' ID for a given item, based on appropriate bot options @@ -30,6 +28,8 @@ module ::RSS [item.title, item.link, desc].hash end + # Add support for Slashdot namespace in RDF. The code is just an adaptation + # of the DublinCore code. unless defined?(SLASH_PREFIX) SLASH_PREFIX = 'slash' SLASH_URI = "http://purl.org/rss/1.0/modules/slash/" @@ -785,8 +785,10 @@ class RSSFeedsPlugin < Plugin link = item.link.chomp if item.link debug item.inspect - category = item.dc_subject rescue item.category rescue nil + category = item.dc_subject rescue item.category.content rescue nil + category = nil if category and category.empty? author = item.dc_creator rescue item.author rescue nil + author = nil if author and author.empty? line1 = nil line2 = nil @@ -794,8 +796,9 @@ class RSSFeedsPlugin < Plugin at = ((item.title && item.link) ? ' @ ' : '') case feed.type when 'blog' + author << " " if author abt = category ? "about #{category} " : "" - line1 = "#{handle}#{date}#{author} blogged #{abt}at #{link}" + line1 = "#{handle}#{date}#{author}blogged #{abt}at #{link}" line2 = "#{handle}#{title} - #{desc}" when 'forum' line1 = "#{handle}#{date}#{title}#{at}#{link}" -- cgit v1.2.3