Commit Graph

28 Commits

Author SHA1 Message Date
Markus Heiser 6e1f1085ef [fix] remove unused import from yahoo-news engine
Signed-off-by: Markus Heiser <markus@darmarit.de>
2021-03-14 15:13:57 +01:00
Markus Heiser d2faea423a [fix] rewrite Yahoo-News engine
Many things have been changed since last review of this engine.  This patch fix
xpath selectors, implements suggestion and is a complete review / rewrite of the
engine.

Signed-off-by: Markus Heiser <markus@darmarit.de>
2021-03-08 11:43:34 +01:00
Alexandre Flament ca93a01844 [mod] dynamically set language_support variable
The language_support variable is set to True by default,
and set to False in only 5 engines.

Except the documentation and the /config URL, this variable is not used.

This commit remove the variable definition in the engines, and
set value according to supported_languages length: False when the length is 0,
True otherwise.

Close #2485
2021-02-01 17:10:37 +01:00
Alexandre Flament a4dcfa025c [enh] engines: add about variable
move meta information from comment to the about variable
so the preferences, the documentation can show these information
2021-01-14 20:57:17 +01:00
Alexandre Flament b00d108673 [mod] pylint: numerous minor code fixes 2020-12-01 15:21:19 +01:00
Alexandre Flament 3038052c79 [mod] remove unused import
use
from searx.engines.duckduckgo import _fetch_supported_languages, supported_languages_url  # NOQA
so it is possible to easily remove all unused import using autoflake:
autoflake --in-place --recursive --remove-all-unused-imports searx tests
2020-11-14 14:11:02 +01:00
Alexandre Flament 2006eb4680 [mod] move extract_text, extract_url to searx.utils 2020-10-02 18:13:56 +02:00
Dalf 1022228d95 Drop Python 2 (1/n): remove unicode string and url_utils 2020-09-10 10:39:04 +02:00
Noémi Ványi b63d645a52 Revert "remove 'all' option from search languages"
This reverts commit 4d1770398a.
2019-01-07 21:19:00 +01:00
Marc Abonce Seguin 772c048d01 refactor engine's search language handling
Add match_language function in utils to match any user given
language code with a list of engine's supported languages.

Also add language_aliases dict on each engine to translate
standard language codes into the custom codes used by the engine.
2018-03-27 00:08:03 -06:00
marc 4d1770398a remove 'all' option from search languages 2017-12-06 01:20:15 -06:00
Adam Tauber 52e615dede [enh] py3 compatibility 2017-05-15 12:02:30 +02:00
Adam Tauber 46a2c63f8e [fix] yahoo news date parsing 2017-04-08 19:45:04 +02:00
marc af35eee10b tests for _fetch_supported_languages in engines
and refactor method to make it testable without making requests
2016-12-15 00:40:21 -06:00
marc f62ce21f50 [mod] fetch supported languages for several engines
utils/fetch_languages.py gets languages supported by each engine and
generates engines_languages.json with each engine's supported language.
2016-12-13 19:58:10 -06:00
marc 149802c569 [enh] add supported_languages on engines and auto-generate languages.py 2016-12-13 19:32:00 -06:00
stepshal b3ab221b98 Fix anomalous backslash in string 2016-07-11 23:53:13 +07:00
Alexandre Flament 44ed4424f6 [fix] yahoo_news engine 2015-05-03 13:41:36 +02:00
Adam Tauber b0fd71b7b3 [fix] pep8 compatibility 2014-10-19 12:18:21 +02:00
Thomas Pointhuber 03db970e6a fix yahoo engines and add comments 2014-09-01 16:17:29 +02:00
Thomas Pointhuber 993271bed3 extract publishDate from vimeo 2014-03-18 15:56:22 +01:00
Thomas Pointhuber 337bd6d907 simplify datetime extraction 2014-03-18 13:19:50 +01:00
Adam Tauber b735093564 [fix] pep8 2014-03-15 20:20:41 +01:00
Thomas Pointhuber 5538c6771a improve publishDate extraction from yahoo 2014-03-15 19:20:29 +01:00
Thomas Pointhuber b88146d669 showing publishedDate for news 2014-03-14 09:55:11 +01:00
Adam Tauber 0fc481f47e [fix] yahoo url extraction 2014-03-08 19:09:03 +01:00
Adam Tauber ee1ffbc87f [fix] yahoo engine url extraction 2014-03-04 14:19:59 +01:00
Thomas Pointhuber f1404ce72d Create yahoo_news.py 2014-03-04 13:11:53 +01:00