X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fdigg.rb;h=dc0ea6c897abaaf0d5d295bc8f51e0cbe963fd9f;hb=052217de30c59206d7025b582d4604557a747470;hp=1e00fabc204261cef08f9ae9e7c7ef0a13e1cfa1;hpb=1df1f3ac9469b9244302de71e302e2b286383560;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/digg.rb b/data/rbot/plugins/digg.rb index 1e00fabc..dc0ea6c8 100644 --- a/data/rbot/plugins/digg.rb +++ b/data/rbot/plugins/digg.rb @@ -13,7 +13,7 @@ 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 unavailable" return @@ -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