diff options
Diffstat (limited to 'data/rbot/plugins/freshmeat.rb')
-rw-r--r-- | data/rbot/plugins/freshmeat.rb | 20 |
1 files changed, 13 insertions, 7 deletions
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 |