Commit Graph

115 Commits

Author SHA1 Message Date
Gordon Shumway
6e47278b9f
Google: Set User-Agent override. (#1426)
With a custom (globally-configured) user-agent, Google may serve a different page, which breaks this plugin.

This override disables this custom user-agent and uses a predefined one, which is known to work.
2020-07-14 14:44:43 +02:00
Valentin Lorentz
2924845de4 Google: Update, with a proper HTML parser.
Hopefully it will be more robust than the regexp.
2020-05-24 18:57:27 +02:00
Valentin Lorentz
f8a14547f9 Google: Update regexp. 2020-05-15 19:56:36 +02:00
Valentin Lorentz
c1ae3f5c81 all plugins: Use msg.channel instead of msg.args[0] + give network name to self.registryValue. 2019-08-24 23:35:01 +02:00
Valentin Lorentz
696254ff1b Use irc.isChannel instead of ircutils.isChannel when possible.
It's aware of the network's 'chantypes'.
2019-08-04 21:52:40 +02:00
Valentin Lorentz
dba0ae3771 Google: update scraping regexp 2019-07-22 21:39:41 +02:00
Valentin Lorentz
540b827213 Google: Update for Google's new HTML layout.
Closes GH-1365
2019-05-28 19:37:52 +02:00
James Lu
73be2bf3d8 Google: update link to supported languages list
Google has since reformatted their docs and moved the language support info to a separate page.
2016-12-18 14:53:01 -08:00
Valentin Lorentz
fa755c3a9c Google: Decode URLs. Closes GH-1260. 2016-08-10 22:52:00 +02:00
James Lu
30ba4bbe22 Google: mention the format of language codes
This might reduce confusion when people do things like "!google translate english to french hello", which produces no result.
2016-07-15 11:48:26 -07:00
James Lu
88a8bbb4d8 Google: remove unused & duplicated imports
"import json" was being done twice. cgi, time, and socket all appear to be unused.
2016-05-11 18:24:36 -07:00
James Lu
218ba764cc Google: self-promot-- add DDG plugin with py2/py3 support 2016-05-06 07:14:25 -07:00
Valentin Lorentz
b6695172c8 Google: Add warning about deprecation. 2016-05-06 09:02:54 +02:00
Valentin Lorentz
de290d12f3 Google: Fix @lucky. 2016-05-05 09:01:51 +02:00
Valentin Lorentz
8321d8a547 Google: Fix URL formatting.
For some reason, it worked on Python 3…
2016-05-05 08:31:04 +02:00
Valentin Lorentz
6f1045ed20 Google: Fixes. 2016-05-05 08:03:10 +02:00
Valentin Lorentz
f8aaddd5b5 Google: Fix google URL. 2016-05-04 19:29:53 +02:00
Valentin Lorentz
b5268d63a3 Google: AJAX API was closed today, using HTML scraping instead. 2016-05-04 19:05:31 +02:00
Jussi Timperi
67e5b55c1a Google: Handle empty results in translate. 2015-10-03 01:06:18 +03:00
Valentin Lorentz
b51075969f Google: Move the main code of translate to a separate function (usable by other plugins). 2015-09-09 21:24:47 +02:00
Valentin Lorentz
c3a2c800f1 Remove need for 2to3. 2015-08-11 16:50:23 +02:00
Valentin Lorentz
f305ff3c02 Remove fix_basestring. 2015-08-10 20:24:11 +02:00
Valentin Lorentz
23ddfbc7e3 Filter & Google: Fix Python 3.2 compatibility. 2015-08-10 19:14:22 +02:00
Valentin Lorentz
c0ac84bb53 Remove need for fix_import, fix_types, and fix_urllib. 2015-08-10 17:55:25 +02:00
Valentin Lorentz
216c5d213f Replace sys.version_info[0] usages with minisix.PY{2,3}. 2015-08-09 00:23:03 +02:00
Valentin Lorentz
be118c3338 Remove use of fix_dict fixer. 2015-08-08 23:08:49 +02:00
Jussi Timperi
a6d1909bd6 Google: restore translate 2015-07-04 02:42:01 +03:00
Valentin Lorentz
faac1b0f2b Google: Remove translate command, as Google broke it. 2015-04-15 01:38:38 +02:00
GLolol
c99dab4df4 Google: show the API's real error message instead of a generic error
This makes it easier to debug issues like #955 in the future, whether it be session limit exceeded, an API change, etc.

Also, remove duplicated checking clause for the HTTP error code.
2015-01-31 00:02:18 -05:00
nyuszika7h
e289a63b14 Google: calc: Remove leftover HTML dump debug code
It spams the logs. Even worse, it uses log.info().
2014-12-22 15:40:10 +01:00
James Lu
a755238ef4 Add/improve help for Debug + plugins from F-W:
- Debug
- Factoids
- Format
- Games
- Google
- Herald
- Internet
- Karma
- Lart
- Math
- Misc
- MoobotFactoids
- Network
- News
- NickAuth
- Nickometer
- Note
- Owner
- Protector
- Quote
- QuoteGrabs
- Relay
- Scheduler
- Seen
- ShrinkUrl
- Status
- String
- Time
- Todo
- Topic
- URL
- Unix
- User
- Utilities
- Web
2014-11-30 12:07:41 -08:00
Rico Dittrich
37ac14e747 fix ProgVal/Limnoria#522 2014-05-02 21:36:03 +02:00
Valentin Lorentz
5d301b653f Merge remote-tracking branch 'origin/speed-up-2to3' into testing
Conflicts:
	locales/fr.po
	plugins/Misc/plugin.py
	sandbox/check_trans.py
	src/i18n.py
2014-02-02 22:28:19 +01:00
Valentin Lorentz
06fdaa792f Continue accelerating the 2to3 step (remove fix_map). 2014-01-21 10:57:38 +01:00
Valentin Lorentz
2fda69b4d6 Continue accelerating the 2to3 step (remove fix_raise). 2014-01-20 15:43:55 +01:00
Valentin Lorentz
4652c9ce51 Start accelerating the 2to3 step (remove fix_apply, fix_buffer, fix_callable, fix_exec, fix_execfile, fix_exitfunc, fix_filter, fix_funcattrs, fix_future, fix_getcwdu, and fix_has_key). 2014-01-20 14:49:47 +01:00
Valentin Lorentz
5341df0254 Google: *copy* the utils.web.defaultHeaders before adding items to it. 2014-01-14 20:55:56 +00:00
spline
be2ad1f11f Google: Fix @calc. 2013-11-29 16:09:37 +01:00
Terje Hoås
599f80ec5f Google: Filter out [, before attempting to interpret Googles response as json. 2013-09-25 10:20:43 +02:00
Valentin Lorentz
40675ffdfa Merge remote-tracking branch 'supybot/master' into testing
Conflicts:
	plugins/Admin/plugin.py
	plugins/BadWords/config.py
	plugins/Filter/plugin.py
	plugins/Google/plugin.py
	plugins/Math/plugin.py
	plugins/Misc/plugin.py
	plugins/Note/plugin.py
	plugins/RSS/plugin.py
	plugins/Seen/test.py
	plugins/ShrinkUrl/config.py
	plugins/ShrinkUrl/plugin.py
	plugins/ShrinkUrl/test.py
	plugins/Status/plugin.py
	plugins/String/config.py
	plugins/String/plugin.py
	plugins/Time/plugin.py
	plugins/Todo/plugin.py
	plugins/Web/plugin.py
	plugins/__init__.py
	scripts/supybot-botchk
	setup.py
	src/__init__.py
	src/callbacks.py
	src/commands.py
	src/conf.py
	src/drivers/Socket.py
	src/ircdb.py
	src/irclib.py
	src/ircutils.py
	src/questions.py
	src/registry.py
	src/schedule.py
	src/test.py
	src/utils/file.py
	src/utils/gen.py
	src/utils/net.py
	src/utils/web.py
	src/world.py
2013-08-24 11:28:29 +02:00
Valentin Lorentz
2a8b8e78a0 Google: Fix URL quoting. 2013-07-19 09:11:08 +00:00
Valentin Lorentz
b360871378 Google: Fix previous commit. 2013-05-30 13:16:36 +00:00
Valentin Lorentz
6e8b7be0f1 Google: Fix @calc. 2013-05-30 13:13:19 +02:00
Valentin Lorentz
a15dea55db Google: Configurable base URL. Closes GH-64. 2013-05-21 18:40:38 +02:00
Valentin Lorentz
93ecc2424f Google: Fix encoding issue. 2013-05-13 14:18:22 +02:00
Valentin Lorentz
10fc03ab19 Google: Fix snarfer with Python 3. 2013-02-24 01:51:40 +01:00
Valentin Lorentz
5b432a781e Google: Restore @calc and @phonebook. 2013-02-03 07:53:55 +00:00
Valentin Lorentz
21c17b8248 Google: Fix Python 3 compatibility of the @translate command. 2013-02-01 17:12:03 +01:00
nyuszika7h
b2fdf83496 Google: Add translate command (needs testing)
https://github.com/myano/jenni/blob/master/modules/translate.py
is where I got the idea from. Say thanks to sbp and yano too! :)

Conflicts:
	plugins/Google/plugin.py
2013-02-01 14:54:13 +00:00
Valentin Lorentz
33048545ea Revert "Google: Remove translate command since their API is gone"
This reverts commit 304facd167.

Conflicts:
	plugins/Google/test.py
2013-02-01 14:49:53 +00:00