Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/isida/3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiSabler <dissy@ya.ru>2014-04-05 15:24:24 +0400
committerdiSabler <dissy@ya.ru>2014-04-05 15:24:24 +0400
commit2870e5f613dfd7d5b345b3faafa2ab63eaf6b1aa (patch)
tree80904b04c5273b153a2ea63f6d3e38dd0e29907f
parent3d1b816742ffa69eb8ce3375f1aba3d5269b25ac (diff)
fix: gcalc
-rw-r--r--.gitignore1
-rw-r--r--data/locales/ru.txt2
-rw-r--r--data/locales/ua.txt2
-rw-r--r--plugins/googleplus.py6
4 files changed, 6 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index d107d20..268880e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@ lib/DNS/*.pyc
lib/chardet/*.pyc
lib/xmpp/*.pyc
plugins/_*.py
+plugins/.*.py
settings/config.py
settings/_*
tmp/isida.pid
diff --git a/data/locales/ru.txt b/data/locales/ru.txt
index f4520df..a107641 100644
--- a/data/locales/ru.txt
+++ b/data/locales/ru.txt
@@ -1832,4 +1832,4 @@ API settings Настройки API
# write locale file: ru.txt
# total: 1479
-# missed translations: 1
+# regenarated without mistakes!
diff --git a/data/locales/ua.txt b/data/locales/ua.txt
index dddd0dc..8391425 100644
--- a/data/locales/ua.txt
+++ b/data/locales/ua.txt
@@ -1832,4 +1832,4 @@ API settings Налаштування API
# write locale file: ua.txt
# total: 1479
-# missed translations: 1
+# regenarated without mistakes!
diff --git a/plugins/googleplus.py b/plugins/googleplus.py
index 11c19b4..e8c9bc4 100644
--- a/plugins/googleplus.py
+++ b/plugins/googleplus.py
@@ -27,11 +27,11 @@ def gcalc(type, jid, nick, text):
if not text.strip(): msg = L('What?','%s/%s'%(jid,nick))
else:
try:
- data = load_page('http://www.google.ru/search?', {'q': text.encode('utf-8'), 'hl': GT('youtube_default_lang')}).decode('utf-8', 'ignore')
- 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])
+ data = load_page('http://www.google.ru/search?', {'q': '%s=' % text.replace('=','').strip().encode('utf-8'), 'hl': GT('youtube_default_lang')}).decode('utf-8', 'ignore')
+ msg = ' '.join([t.strip() for t in re.findall('<span class="cwclet" id="cwles">(.*?)</span> </div> </div>.*?<span class="cwcot" id="cwos">(.*?)</span> <script>',data)[0]])
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()
+ try: msg = reduce_spaces_all(' '.join(re.findall('<div class="vk_gy vk_sh">(.*?)</div><div class="vk_ans vk_bk">(.*?)</div>',data,re.S)[0])).strip()
except: msg = L('Google Calculator results not found','%s/%s'%(jid,nick))
send_msg(type, jid, nick, msg)