From dc037235e33a99242e612f9465398cbecdfbc173 Mon Sep 17 00:00:00 2001 From: Yaohan Chen Date: Sat, 11 Aug 2007 03:57:13 +0000 Subject: * translator.rb: use Irc::Utils.bot --- data/rbot/plugins/translator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/rbot/plugins/translator.rb') diff --git a/data/rbot/plugins/translator.rb b/data/rbot/plugins/translator.rb index 47ff329f..0a1dc22d 100644 --- a/data/rbot/plugins/translator.rb +++ b/data/rbot/plugins/translator.rb @@ -239,8 +239,8 @@ class WorldlingoTranslator < Translator end def translate(text, from, to) - response = Irc::Plugins.manager['translator'].bot.httputil.get_response( - URI.escape("http://www.worldlingo.com/SEfpX0LV2xIxsIIELJ,2E5nOlz5RArCY,/texttranslate?wl_srcenc=utf-8&wl_trgenc=utf-8&wl_text=#{text}&wl_srclang=#{from.upcase}&wl_trglang=#{to.upcase}")) + response = Irc::Utils.bot.httputil.get_response(URI.escape( + "http://www.worldlingo.com/SEfpX0LV2xIxsIIELJ,2E5nOlz5RArCY,/texttranslate?wl_srcenc=utf-8&wl_trgenc=utf-8&wl_text=#{text}&wl_srclang=#{from.upcase}&wl_trglang=#{to.upcase}")) # WorldLingo seems to respond an XML when error occurs case response['Content-Type'] when %r'text/plain' -- cgit v1.2.3