X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Ffreshmeat.rb;h=dce6c0d495678bf0ab5351ac68606fa0d2fdce95;hb=6188a50d4ba6171481224bc897b45facd286f037;hp=494cfb48b2374553d4f753e15548d3cc9d845a66;hpb=fdf1bc954352f19818f5f9f1c86643a2f8ef40c6;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/freshmeat.rb b/data/rbot/plugins/freshmeat.rb index 494cfb48..dce6c0d4 100644 --- a/data/rbot/plugins/freshmeat.rb +++ b/data/rbot/plugins/freshmeat.rb @@ -49,7 +49,13 @@ class FreshmeatPlugin < Plugin m.reply "search for #{search} failed" return end - doc = Document.new xml + doc = nil + begin + doc = Document.new xml + rescue + debug xml + error $! + end unless doc m.reply "search for #{search} failed" return @@ -87,7 +93,7 @@ class FreshmeatPlugin < Plugin max = params[:limit].to_i max = 8 if max > 8 begin - xml = @bot.httputil.get('http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml') + xml = @bot.httputil.get('http://freshmeat.net/backend/fm-releases-global.xml') unless xml m.reply "freshmeat news parse failed" return @@ -107,8 +113,8 @@ class FreshmeatPlugin < Plugin title_width = 0 done = 0 doc.elements.each("*/channel/item") {|e| - desc = e.elements["description"].text - title = e.elements["title"].text + desc = e.elements["description"].text.ircify_html + title = e.elements["title"].text.ircify_html #title.gsub!(/\s+\(.*\)\s*$/, "") title.strip! title_width = title.length if title.length > title_width