-# TODO: cache definitions\r
-\r
require 'erb'\r
\r
class DeMauroPlugin < Plugin\r
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
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
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
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