diff options
author | diSabler <dissy@ya.ru> | 2014-01-18 22:35:28 +0400 |
---|---|---|
committer | diSabler <dissy@ya.ru> | 2014-01-18 22:35:28 +0400 |
commit | 90cc0319954a36d00b88fbfe7480cc8443255b2c (patch) | |
tree | f48b3c5cd03e1d3c351d15a9848975128e4bf47e | |
parent | c11cfeb3ffbe4abdc1ada76854ffd2c00ebdc64c (diff) |
fix: values with power in gcalc
-rw-r--r-- | plugins/googleplus.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/googleplus.py b/plugins/googleplus.py index 1f4d8ee..4ab60c4 100644 --- a/plugins/googleplus.py +++ b/plugins/googleplus.py @@ -29,6 +29,7 @@ def gcalc(type, jid, nick, text): try: data = load_page('http://www.google.ru/search?', {'q': text.encode('utf-8'), 'hl': GT('youtube_default_lang')}) msg = ' '.join(re.findall('<div class="vk_gy vk_sh" style="margin-bottom:5px">(.*?)</div><div class="vk_ans vk_bk" style="margin-bottom:0">(.*?)</div>',data)[0]).decode('utf-8', 'ignore') + msg = msg.replace('<sup>2</sup>',u'²').replace('<sup>3</sup>',u'³') except: try: msg = reduce_spaces_all(' '.join(re.findall('<span class="cwclet" id="cwles">(.*?)</span>.*?<span class="cwcot" id="cwos">(.*?)</span>',data,re.S)[0])).strip() except: msg = L('Google Calculator results not found','%s/%s'%(jid,nick)) |