X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fslashdot.rb;h=71411458e7300565cd1b069d240b1e39ade44953;hb=29faf7573130bb0f672f4a9cd3a62bcdd409f4cc;hp=b02a5a25809c4733b19299175099df507ff638a2;hpb=fdf1bc954352f19818f5f9f1c86643a2f8ef40c6;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/slashdot.rb b/data/rbot/plugins/slashdot.rb index b02a5a25..71411458 100644 --- a/data/rbot/plugins/slashdot.rb +++ b/data/rbot/plugins/slashdot.rb @@ -21,8 +21,13 @@ class SlashdotPlugin < Plugin loc = Utils.check_location(s, /slashdot\.org/) return nil unless loc h = Hpricot(s[:text]) - title = (h/"head/title").first.to_html.ircify_html + # If we have no title tag in a head tag, return as this is not + # a /. page (it's probably a Slashdot RSS + ht = h/"head/title" + return nil if ht.empty? + title = ht.first.to_html.ircify_html arts = (h/"div.article") + return nil if arts.empty? if arts.length > 1 tits = [] arts.each { |el|