X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fslashdot.rb;h=71411458e7300565cd1b069d240b1e39ade44953;hb=41ea4232df0ed0b3f922b0476444ca8e38f3301f;hp=b02a5a25809c4733b19299175099df507ff638a2;hpb=fce8443bb6ab99c3b36fc95583bb59275f019251;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|