diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-14 13:12:17 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-14 13:12:17 +0000 |
commit | c7205ab96ecd7adb8ec0f7ebb3ee121d3d922023 (patch) | |
tree | 869ece3d31a3fc14d58c23a204d5e910630d7e70 /data/rbot | |
parent | 4c77323d46f10bd0a116b9e4eed7034ba4fcc1b4 (diff) |
Minor tuning for demauro
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/demauro.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/data/rbot/plugins/demauro.rb b/data/rbot/plugins/demauro.rb index b502238e..436a0bd3 100644 --- a/data/rbot/plugins/demauro.rb +++ b/data/rbot/plugins/demauro.rb @@ -1,4 +1,4 @@ -require 'erb'
+require 'uri'
DEMAURO_LEMMA = /<anchor>(.*?)(?: - (.*?))<go href="lemma.php\?ID=(\d+)"\/><\/anchor>/
class DeMauroPlugin < Plugin
@@ -15,7 +15,7 @@ class DeMauroPlugin < Plugin def demauro(m, params)
parola = params[:parola].downcase
- url = @wapurl + "index.php?lemma=#{ERB::Util.url_encode(parola)}"
+ url = @wapurl + "index.php?lemma=#{URI.escape(parola)}"
xml = @bot.httputil.get(url)
if xml.nil?
info = @bot.httputil.last_response
@@ -33,7 +33,7 @@ class DeMauroPlugin < Plugin text += " not found. Similar words"
end
text += ": "
- text += entries[0..5].map { |ar|
+ text += entries[0...5].map { |ar|
"#{ar[0]} - #{ar[1].gsub(/<\/?em>/,'')}: #{@dmurl}#{ar[2]}"
}.join(" | ")
m.reply text
|