diff options
author | Okasu <oka.sux@gmail.com> | 2011-12-25 17:13:30 -0500 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2011-12-26 09:58:30 +0100 |
commit | c32c3ef9180dcf4dc22829f1795b666da06008bf (patch) | |
tree | 6320ab46e6962e6595d0f7b8ff0e00560d8254c2 /data/rbot | |
parent | d45c5f5eeba4bcdcc75c7991d4a1f8c390a76d01 (diff) |
Googlefight plugin fix
Diffstat (limited to 'data/rbot')
-rwxr-xr-x | data/rbot/plugins/googlefight.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/data/rbot/plugins/googlefight.rb b/data/rbot/plugins/googlefight.rb index 894d2233..7fc748c0 100755 --- a/data/rbot/plugins/googlefight.rb +++ b/data/rbot/plugins/googlefight.rb @@ -54,11 +54,11 @@ class GoogleFightPlugin < Plugin def google_count(query) url = 'http://www.google.com/search?hl=en&safe=off&btnG=Search&q=' << CGI.escape(query) html = Net::HTTP.get(URI.parse((url))) - res = html.scan(%r{>About ([\d,]+) results<nobr>}) - res.to_s.tr(",", "").to_i + res = html.scan(%r{of about <b>([\d,]+)<\/b>}) + res[0][0].to_s.tr(",", "").to_i end end plugin = GoogleFightPlugin.new plugin.map "googlefight *keywords", :action => "fight", - :requirements => { :keywords => /^[\w\s"]+? (?:(?:(?:\||vs\.) )?[\w\s"]+?)+/ }
\ No newline at end of file + :requirements => { :keywords => /^[\w\s"]+? (?:(?:(?:\||vs\.) )?[\w\s"]+?)+/ } |