Update googleSnarfer to use the new search method

This commit is contained in:
James Vega 2008-10-01 20:17:51 +00:00
parent 2b7c36c747
commit 6cfde5bcc9
1 changed files with 4 additions and 8 deletions

View File

@ -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: <b>([^<]+)</b>', re.I)