From 55a13ec9c487860975f0fe491fbc1a7c2357c6ac Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 23 Mar 2008 00:50:56 +0100 Subject: slashdot plugin: check if we are parsing an actual /. page rather than an rss feed --- data/rbot/plugins/slashdot.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'data') diff --git a/data/rbot/plugins/slashdot.rb b/data/rbot/plugins/slashdot.rb index b02a5a25..657cc009 100644 --- a/data/rbot/plugins/slashdot.rb +++ b/data/rbot/plugins/slashdot.rb @@ -21,8 +21,12 @@ class SlashdotPlugin < Plugin loc = Utils.check_location(s, /slashdot\.org/) return nil unless loc h = Hpricot(s[:text]) + # If we have no title tag in a head tag, return as this is not + # a /. page (it's probably a Slashdot RSS + return nil if h/"head/title".empty? title = (h/"head/title").first.to_html.ircify_html arts = (h/"div.article") + return nil if arts.empty? if arts.length > 1 tits = [] arts.each { |el| -- cgit v1.2.3