diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-03-23 00:50:56 +0100 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-03-23 00:50:56 +0100 |
commit | 55a13ec9c487860975f0fe491fbc1a7c2357c6ac (patch) | |
tree | ca39bc0c443efeec91d4b3302dd5c41433137221 /data | |
parent | 09a5d3188420a10590917b7abc2de6cffb4327f5 (diff) |
slashdot plugin: check if we are parsing an actual /. page rather than an rss feed
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/slashdot.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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| |