diff options
author | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-03-10 12:11:17 +0000 |
---|---|---|
committer | Tom Gilbert <tom@linuxbrit.co.uk> | 2005-03-10 12:11:17 +0000 |
commit | 787c3322e0c1acdccb457c47bea76f31c5747f52 (patch) | |
tree | 6dc7e8e1bb39907208c441994127e4d6e63da03c /rbot/plugins/google.rb | |
parent | bebe7f8392f3f1750bc196cb19bd4bfbda3310b6 (diff) |
fix http usage, other tweaks
Diffstat (limited to 'rbot/plugins/google.rb')
-rw-r--r-- | rbot/plugins/google.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/rbot/plugins/google.rb b/rbot/plugins/google.rb index 5fa466e7..2e9aacba 100644 --- a/rbot/plugins/google.rb +++ b/rbot/plugins/google.rb @@ -29,21 +29,21 @@ class GooglePlugin < Plugin http = Net::HTTP.new("www.google.com", 80, proxy_host, proxy_port) - http.start {|http| - begin - resp , = http.get(query) + begin + http.start {|http| + resp = http.get(query) if resp.code == "302" result = resp['location'] end - rescue => e - p e - if e.response && e.response['location'] - result = e.response['location'] - else - result = "error!" - end + } + rescue => e + p e + if e.response && e.response['location'] + result = e.response['location'] + else + result = "error!" end - } + end m.reply "#{m.params}: #{result}" end end |