From 6cfde5bcc91c78c9ec6ac9d5152d41942e98fce9 Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 1 Oct 2008 20:17:51 +0000 Subject: [PATCH] Update googleSnarfer to use the new search method --- plugins/Google/plugin.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index 840fae8ab..a8d8c6e7b 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -272,14 +272,10 @@ class Google(callbacks.PluginRegexp): if not self.registryValue('searchSnarfer', msg.args[0]): return searchString = match.group(1) - try: - data = self.search(searchString, msg.args[0], - {'smallsearch': True}) - except callbacks.Error: - return - if data.results: - url = data.results[0].URL - irc.reply(url, prefixNick=False) + data = self.search(searchString, msg.args[0], {'smallsearch': True}) + if data['responseData']['results']: + url = data['responseData']['results'][0]['unescapedUrl'] + irc.reply(url.encode('utf-8'), prefixNick=False) googleSnarfer = urlSnarfer(googleSnarfer) _ggThread = re.compile(r'Subject: ([^<]+)', re.I)