]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/demauro.rb
nickserv password now tries to inform the nickserv of the password change; it can...
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / demauro.rb
index 7e5705a1e3596280695cdb2c7764c477d033f64c..12a784ffa4390b41acea0b5152a89e71ae38044f 100644 (file)
@@ -1,5 +1,3 @@
-# TODO: cache definitions\r
-\r
 require 'erb'\r
 \r
 class DeMauroPlugin < Plugin\r
@@ -24,7 +22,7 @@ class DeMauroPlugin < Plugin
     defurls = Array.new\r
     begin\r
       http.start() { |http|\r
-       resp = http.get(uri)\r
+       resp = http.get(uri.request_uri())\r
        case resp.code\r
        when "200"\r
          xml = resp.body\r
@@ -38,8 +36,9 @@ class DeMauroPlugin < Plugin
        end\r
       }\r
     rescue => e\r
-      debug "HttpUtil.get exception: #{e}, while trying to get #{uri}"\r
-      m.reply "Errore"\r
+      debug "HttpUtil.get exception: #{e.inspect}, while trying to get #{uri}"\r
+      debug e.backtrace.join("\n")\r
+      m.reply "C'è stato un errore nella ricerca"\r
       return\r
     end\r
     if xml\r
@@ -60,7 +59,7 @@ class DeMauroPlugin < Plugin
       begin\r
        debug "Scanning #{url}"\r
        http.start() { |http|\r
-         resp = http.get(uri)\r
+         resp = http.get(uri.request_uri())\r
          case resp.code\r
          when "200"\r
            debug "Got data"\r
@@ -80,8 +79,9 @@ class DeMauroPlugin < Plugin
          end\r
        }\r
       rescue => e\r
-       debug "Exception '#{e}' while trying to get and parse #{uri}"\r
-       m.reply "Errore"\r
+       debug "Exception '#{e.inspect}' while trying to get and parse #{uri}"\r
+       debug e.backtrace.join("\n")\r
+       m.reply "C'è stato un errore nell'elaborazione del risultato"\r
        return\r
       end\r
     }\r