diff --git a/plugins/Google/locale/fr.po b/plugins/Google/locale/fr.po index c5c57b5a4..fb81dc957 100644 --- a/plugins/Google/locale/fr.po +++ b/plugins/Google/locale/fr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Supybot-fr\n" -"POT-Creation-Date: 2010-10-17 14:50+CEST\n" +"POT-Creation-Date: 2011-02-14 18:30+CET\n" "PO-Revision-Date: \n" "Last-Translator: Valentin Lorentz \n" "Language-Team: Supybot-fr \n" @@ -101,7 +101,7 @@ msgstr "" " " #: plugin.py:141 -#: plugin.py:192 +#: plugin.py:200 msgid "We broke The Google!" msgstr "Google est toukassay !" @@ -111,20 +111,21 @@ msgstr "Aucune correspondance." #: plugin.py:167 msgid "" -"\n" +"[--snippet] \n" "\n" " Does a google search, but only returns the first result.\n" +" If option --snippet is given, returns also the page text snippet.\n" " " msgstr "" -"\n" +"[--snippet] \n" "\n" -"Effectue une recherche google, mais ne retourne que le premier résultat." +"Effectue une recherche google, mais ne retourne que le premier résultat. Si l'option --snippet est donnée, retournera également un fragment de la page." -#: plugin.py:176 +#: plugin.py:184 msgid "Google found nothing." msgstr "Google n'a rien trouvé." -#: plugin.py:181 +#: plugin.py:189 msgid "" " [--{filter,language} ]\n" "\n" @@ -137,7 +138,7 @@ msgstr "" "\n" "Rercherche la chaîne donnée sur Google. Autant de résultats que possible sont donnés. --language accepte une abbréviation de langue ; --filter accepte un niveau de filtrage ('active', 'moderate', 'off')." -#: plugin.py:204 +#: plugin.py:212 msgid "" "\n" "\n" @@ -148,11 +149,11 @@ msgstr "" "\n" "Retourne un lien vers la version en cache de l', si elle est disponible." -#: plugin.py:215 +#: plugin.py:223 msgid "Google seems to have no cache for that site." msgstr "Google semble ne pas avoir de cache pour ce site." -#: plugin.py:220 +#: plugin.py:228 msgid "" " [ ...]\n" "\n" @@ -164,7 +165,7 @@ msgstr "" "\n" "Retourne les résultats de chaque recherche, dans l'ordre, par ordre croissant du nombre de résultats." -#: plugin.py:244 +#: plugin.py:252 msgid "" " [to] \n" "\n" @@ -176,24 +177,24 @@ msgstr "" " [to] \n" "\n" -#: plugin.py:263 +#: plugin.py:271 msgid "from language" msgstr "de la langue" -#: plugin.py:264 -#: plugin.py:273 +#: plugin.py:272 +#: plugin.py:281 msgid "Valid languages are: %L" msgstr "Les langues valides sont : %L" -#: plugin.py:272 +#: plugin.py:280 msgid "to language" msgstr "vers la langue" -#: plugin.py:289 +#: plugin.py:297 msgid "^google\\s+(.*)$" msgstr "^google\\s+(.*)$" -#: plugin.py:311 +#: plugin.py:320 msgid "" "\n" "\n" @@ -204,11 +205,11 @@ msgstr "" "\n" "Utilise la calculatrice Google pour calculer la valeur de l'." -#: plugin.py:325 +#: plugin.py:337 msgid "Google's calculator didn't come up with anything." msgstr "La calculatrice Google ne donne aucun résultat." -#: plugin.py:331 +#: plugin.py:343 msgid "" "\n" "\n" @@ -219,7 +220,7 @@ msgstr "" "\n" "Recherche le sur Google." -#: plugin.py:345 +#: plugin.py:357 msgid "Google's phonebook didn't come up with anything." msgstr "L'annuaire téléphonique de Google ne donne aucun résultat." diff --git a/plugins/Google/messages.pot b/plugins/Google/messages.pot index 9493dd858..460da8a27 100644 --- a/plugins/Google/messages.pot +++ b/plugins/Google/messages.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2010-10-17 14:50+CEST\n" +"POT-Creation-Date: 2011-02-14 18:30+CET\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -95,7 +95,7 @@ msgid "" " " msgstr "" -#: plugin.py:141 plugin.py:192 +#: plugin.py:141 plugin.py:200 msgid "We broke The Google!" msgstr "" @@ -106,17 +106,18 @@ msgstr "" #: plugin.py:167 #, docstring msgid "" -"\n" +"[--snippet] \n" "\n" " Does a google search, but only returns the first result.\n" +" If option --snippet is given, returns also the page text snippet.\n" " " msgstr "" -#: plugin.py:176 +#: plugin.py:184 msgid "Google found nothing." msgstr "" -#: plugin.py:181 +#: plugin.py:189 #, docstring msgid "" " [--{filter,language} ]\n" @@ -127,7 +128,7 @@ msgid "" " " msgstr "" -#: plugin.py:204 +#: plugin.py:212 #, docstring msgid "" "\n" @@ -136,11 +137,11 @@ msgid "" " " msgstr "" -#: plugin.py:215 +#: plugin.py:223 msgid "Google seems to have no cache for that site." msgstr "" -#: plugin.py:220 +#: plugin.py:228 #, docstring msgid "" " [ ...]\n" @@ -150,7 +151,7 @@ msgid "" " " msgstr "" -#: plugin.py:244 +#: plugin.py:252 #, docstring msgid "" " [to] \n" @@ -161,24 +162,24 @@ msgid "" " " msgstr "" -#: plugin.py:263 +#: plugin.py:271 msgid "from language" msgstr "" -#: plugin.py:264 plugin.py:273 +#: plugin.py:272 plugin.py:281 msgid "Valid languages are: %L" msgstr "" -#: plugin.py:272 +#: plugin.py:280 msgid "to language" msgstr "" -#: plugin.py:289 +#: plugin.py:297 #, docstring msgid "^google\\s+(.*)$" msgstr "" -#: plugin.py:311 +#: plugin.py:320 #, docstring msgid "" "\n" @@ -187,11 +188,11 @@ msgid "" " " msgstr "" -#: plugin.py:325 +#: plugin.py:337 msgid "Google's calculator didn't come up with anything." msgstr "" -#: plugin.py:331 +#: plugin.py:343 #, docstring msgid "" "\n" @@ -200,7 +201,7 @@ msgid "" " " msgstr "" -#: plugin.py:345 +#: plugin.py:357 msgid "Google's phonebook didn't come up with anything." msgstr "" diff --git a/plugins/Google/plugin.py b/plugins/Google/plugin.py index 59660fc69..3c87e8b0e 100644 --- a/plugins/Google/plugin.py +++ b/plugins/Google/plugin.py @@ -163,18 +163,26 @@ class Google(callbacks.PluginRegexp): return format('; '.join(results)) @internationalizeDocstring - def lucky(self, irc, msg, args, text): - """ + def lucky(self, irc, msg, args, opts, text): + """[--snippet] Does a google search, but only returns the first result. + If option --snippet is given, returns also the page text snippet. """ + opts = dict(opts) data = self.search(text, msg.args[0], {'smallsearch': True}) if data['responseData']['results']: - url = data['responseData']['results'][0]['unescapedUrl'] - irc.reply(url.encode('utf-8')) + url = data['responseData']['results'][0]['unescapedUrl'].encode('utf-8') + if opts.has_key('snippet'): + snippet = data['responseData']['results'][0]['content'].encode('utf-8') + snippet = " | " + utils.web.htmlToText(snippet, tagReplace='') + else: + snippet = "" + result = url + snippet + irc.reply(result) else: irc.reply(_('Google found nothing.')) - lucky = wrap(lucky, ['text']) + lucky = wrap(lucky, [getopts({'snippet':'',}), 'text']) @internationalizeDocstring def google(self, irc, msg, args, optlist, text):