]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/freshmeat.rb
Improve help.
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / freshmeat.rb
index 20fa724800fb228a693e463608f1eef3dc230e71..eb2dbdf7e0dafd6f700c756ff0d86cf22e644a3f 100644 (file)
@@ -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