# TODO:: use lr=lang_<code> or whatever is most appropriate to let google know
# it shouldn't use the bot's location to find the preferred language
-require 'uri'
-
-Net::HTTP.version_1_2
-
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>}
def google(m, params)
what = params[:words].to_s
- searchfor = URI.escape what
+ searchfor = CGI.escape what
# This method is also called by other methods to restrict searching to some sites
if params[:site]
site = "site:#{params[:site]}+"
def gcalc(m, params)
what = params[:words].to_s
- searchfor = URI.escape(what).sub('+','%2B')
+ searchfor = CGI.escape(what)
debug "Getting gcalc thing: #{searchfor.inspect}"
url = "http://www.google.com/search?q=#{searchfor}"