From 41154292efa3b510f605143455fc3836c05e9750 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 18 Oct 2006 22:40:59 +0000 Subject: Fix the no-date bug the right way --- data/rbot/plugins/rss.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 7d926604..be7a3271 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -229,15 +229,15 @@ class RSSFeedsPlugin < Plugin end def itemDate(item,ex=nil) - return item.pubDate if item.respond_to?(:pubDate) - return item.date if item.respond_to?(:date) + return item.pubDate if item.respond_to?(:pubDate) and item.pubDate + return item.date if item.respond_to?(:date) and item.date return ex end def freshness_sort(items) notime = Time.at(0) items.sort { |a, b| - itemDate(b, notime) || 0 <=> itemDate(a, notime) || 0 + itemDate(b, notime) <=> itemDate(a, notime) } end -- cgit v1.2.3