From bf48c8af75fd14ac9f4f7446d5edeb13e553ea2c Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 25 Jul 2006 22:09:25 +0000 Subject: Make demauro work with Ruby 1.8.4 too --- data/rbot/plugins/demauro.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 } -- cgit v1.2.3