diff options
-rw-r--r-- | data/rbot/plugins/search.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/data/rbot/plugins/search.rb b/data/rbot/plugins/search.rb index b8825bcb..c4bf0db1 100644 --- a/data/rbot/plugins/search.rb +++ b/data/rbot/plugins/search.rb @@ -16,7 +16,7 @@ # for most languages GOOGLE_WAP_LINK = /<a accesskey="(\d)" href=".*?u=(.*?)">(.*?)<\/a>/im -GOOGLE_CALC_RESULT = %r{<p><table><tr><td><img src=/images/calc_img\.gif></td><td> </td><td nowrap><font size=\+1><b>(.+)</b></td></tr><tr><td>} +GOOGLE_CALC_RESULT = %r{<p><table><tr><td><img src=/images/calc_img\.gif(?: alt="")?></td><td> </td><td nowrap>(?:<h2 class=r>)?<font size=\+1><b>(.+)</b>(?:</h2>)?</td></tr><tr><td>} class SearchPlugin < Plugin BotConfig.register BotConfigIntegerValue.new('google.hits', @@ -108,7 +108,7 @@ class SearchPlugin < Plugin searchfor = CGI.escape(what) debug "Getting gcalc thing: #{searchfor.inspect}" - url = "http://www.google.com/search?q=#{searchfor}" + url = "http://www.google.com/search?oe=UTF-8&q=#{searchfor}" begin html = @bot.httputil.get(url) |