#!/usr/bin/python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # # # # Plugin for iSida Jabber Bot # # Copyright (C) Vit@liy # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # # # # --------------------------------------------------------------------------- # # translate: verb,noun,preposition,adverb,adjective,phrase,conjunction,abbreviation,Google URL Shortener/Unshortener,Google QR-code generator 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': '%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('(.*?) .*?(.*?)