X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fdemauro.rb;h=12a784ffa4390b41acea0b5152a89e71ae38044f;hb=6b4751c8b6e99dcff80cfe5e66c746cf9106dc6a;hp=7e5705a1e3596280695cdb2c7764c477d033f64c;hpb=ec67cbca6543d4eb7a95e83fb10f340383bb47e7;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/demauro.rb b/data/rbot/plugins/demauro.rb index 7e5705a1..12a784ff 100644 --- a/data/rbot/plugins/demauro.rb +++ b/data/rbot/plugins/demauro.rb @@ -1,5 +1,3 @@ -# TODO: cache definitions - require 'erb' class DeMauroPlugin < Plugin @@ -24,7 +22,7 @@ class DeMauroPlugin < Plugin defurls = Array.new begin http.start() { |http| - resp = http.get(uri) + resp = http.get(uri.request_uri()) case resp.code when "200" xml = resp.body @@ -38,8 +36,9 @@ class DeMauroPlugin < Plugin end } rescue => e - debug "HttpUtil.get exception: #{e}, while trying to get #{uri}" - m.reply "Errore" + debug "HttpUtil.get exception: #{e.inspect}, while trying to get #{uri}" + debug e.backtrace.join("\n") + m.reply "C'è stato un errore nella ricerca" return end if xml @@ -60,7 +59,7 @@ class DeMauroPlugin < Plugin begin debug "Scanning #{url}" http.start() { |http| - resp = http.get(uri) + resp = http.get(uri.request_uri()) case resp.code when "200" debug "Got data" @@ -80,8 +79,9 @@ class DeMauroPlugin < Plugin end } rescue => e - debug "Exception '#{e}' while trying to get and parse #{uri}" - m.reply "Errore" + debug "Exception '#{e.inspect}' while trying to get and parse #{uri}" + debug e.backtrace.join("\n") + m.reply "C'è stato un errore nell'elaborazione del risultato" return end }