mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-14 14:49:21 +01:00
Google: fix encoding bug in lucky --snippet; need to pass encoded string to utils.web.htmlToText
This commit is contained in:
parent
d469108054
commit
3a181b6dd2
@ -168,14 +168,14 @@ class Google(callbacks.PluginRegexp):
|
||||
opts = dict(opts)
|
||||
data = self.search(text, msg.args[0], {'smallsearch': True})
|
||||
if data['responseData']['results']:
|
||||
url = data['responseData']['results'][0]['unescapedUrl']
|
||||
url = data['responseData']['results'][0]['unescapedUrl'].encode('utf-8')
|
||||
if opts.has_key('snippet'):
|
||||
snippet = data['responseData']['results'][0]['content']
|
||||
snippet = data['responseData']['results'][0]['content'].encode('utf-8')
|
||||
snippet = " | " + utils.web.htmlToText(snippet, tagReplace='')
|
||||
else:
|
||||
snippet = ""
|
||||
result = url + snippet
|
||||
irc.reply(result.encode('utf-8'))
|
||||
irc.reply(result)
|
||||
else:
|
||||
irc.reply('Google found nothing.')
|
||||
lucky = wrap(lucky, [getopts({'snippet':'',}), 'text'])
|
||||
|
Loading…
Reference in New Issue
Block a user