diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-25 22:09:25 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-07-25 22:09:25 +0000 |
commit | bf48c8af75fd14ac9f4f7446d5edeb13e553ea2c (patch) | |
tree | e682fbb36dc14d5bbd34be05ec6b996085929aa4 /data | |
parent | ec3d1be17e63139be117a7a61208bacf9cb01c7e (diff) |
Make demauro work with Ruby 1.8.4 too
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/demauro.rb | 16 |
1 files 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
}
|