X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Ffreshmeat.rb;h=eb2dbdf7e0dafd6f700c756ff0d86cf22e644a3f;hb=d9407a6d5a29d95afa179fae4b33dbee861ca6b4;hp=20fa724800fb228a693e463608f1eef3dc230e71;hpb=21949774b91eaec6ecde4eaa8ad121e2c0a36b87;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/freshmeat.rb b/data/rbot/plugins/freshmeat.rb index 20fa7248..eb2dbdf7 100644 --- a/data/rbot/plugins/freshmeat.rb +++ b/data/rbot/plugins/freshmeat.rb @@ -58,16 +58,22 @@ class FreshmeatPlugin < Plugin def freshmeat(m, params) max = params[:limit].to_i max = 8 if max > 8 - xml = @bot.httputil.get(URI.parse("http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml")) - unless xml - m.reply "freshmeat news parse failed" - return - end - doc = Document.new xml - unless doc + begin + xml = @bot.httputil.get(URI.parse("http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml")) + unless xml + m.reply "freshmeat news parse failed" + return + end + doc = Document.new xml + unless doc + m.reply "freshmeat news parse failed" + return + end + rescue m.reply "freshmeat news parse failed" return end + matches = Array.new max_width = 60 title_width = 0