summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/slashdot.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/data/rbot/plugins/slashdot.rb b/data/rbot/plugins/slashdot.rb
index 71411458..5b3c2f3b 100644
--- a/data/rbot/plugins/slashdot.rb
+++ b/data/rbot/plugins/slashdot.rb
@@ -31,7 +31,20 @@ class SlashdotPlugin < Plugin
if arts.length > 1
tits = []
arts.each { |el|
- artitle = (el/"div.generaltitle").first.to_html.ircify_html
+ # see if the div tag with generaltitle class is present
+ artitle = (el/"div.generaltitle").first
+ if artitle
+ tits << artitle.to_html.ircify_html
+ next
+ end
+ # otherwise, check for skin+datitle a tags
+ datitle = (el/"a.datitle").first
+ next unless datitle
+ skin = (el/"a.skin").first
+ artitle = [
+ skin ? skin.innerHTML.ircify_html : nil,
+ datitle.innerHTML.ircify_html
+ ].compact.join(" ")
tits << artitle
}
content = tits.join(" | ")