summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-14 08:41:45 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-14 08:41:45 +0000
commit1107570cb696e4d9f870da00282233b60b8a00ca (patch)
treef3c330782d1a9b50657539b0dc25a62257afdad5
parent3cd4ae515218dbd00953143c48cf48e3088d54e9 (diff)
rss plugin: fix bugs with category retrieval and author display
-rw-r--r--data/rbot/plugins/rss.rb11
1 files 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}"