]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/digg.rb
quiz: stop quizzes and timers on cleanup
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / digg.rb
index 259629196d6368496253ad04755102e3faa36585..dc0ea6c897abaaf0d5d295bc8f51e0cbe963fd9f 100644 (file)
@@ -13,9 +13,9 @@ class DiggPlugin < Plugin
   def digg(m, params)
     max = params[:limit].to_i
     debug "max is #{max}"
-    xml = @bot.httputil.get('http://digg.com/rss/index.xml')
+    xml = @bot.httputil.get('http://services.digg.com/2.0/story.getTopNews?type=rss')
     unless xml
-      m.reply "digg news parse failed"
+      m.reply "digg news unavailable"
       return
     end
     doc = Document.new xml
@@ -32,7 +32,7 @@ class DiggPlugin < Plugin
     max = 8 if max > 8
     matches = Array.new
     doc.elements.each("rss/channel/item") {|e|
-      matches << [ e.elements["title"].text,
+      matches << [ e.elements["title"].text.strip,
                    Time.parse(e.elements["pubDate"].text).strftime('%a @ %I:%M%p') ]
       done += 1
       break if done >= max