diff options
| author | Markus Heiser <markus.heiser@darmarIT.de> | 2025-10-03 08:40:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-03 08:40:24 +0200 |
| commit | c6f1ea12b1d7c4088680295a8e19a598466fabb6 (patch) | |
| tree | 706ef81fe64fa11fcf23548e0f3d0b628c8196f0 /searx/engines | |
| parent | 06e4f4f758d9494cbb7916079a4743ea11f5c374 (diff) | |
[fix] engine - cppreference has no longer a search function (#5273)
cppreference has replaced its search (``mwiki/index.php?title=``) with a DDG
search.
The engine was first introduced in SearXNG with PR-3274 [1], and even back then
the mediawiki proved to be incompatible, which is why the API could not be used
at the time. Now there isn't even a dedicated search function anymore.. I think
the cppreference project suffers from a lack of maintenance.
[1] https://github.com/searxng/searxng/pull/3247
Closes: https://github.com/searxng/searxng/issues/5271
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines')
| -rw-r--r-- | searx/engines/cppreference.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/searx/engines/cppreference.py b/searx/engines/cppreference.py deleted file mode 100644 index 5d021fe66..000000000 --- a/searx/engines/cppreference.py +++ /dev/null @@ -1,37 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -"""Cppreference""" -from lxml import html -from searx.utils import eval_xpath - - -about = { - "website": "https://en.cppreference.com/", - "wikidata_id": None, - "official_api_documentation": None, - "use_official_api": False, - "require_api_key": False, - "results": 'HTML', -} - - -categories = ['it'] -url = 'https://en.cppreference.com/' -search_url = url + 'mwiki/index.php?title=Special%3ASearch&search={query}' - - -def request(query, params): - params['url'] = search_url.format(query=query) - return query - - -def response(resp): - results = [] - dom = html.fromstring(resp.text) - for result in eval_xpath(dom, '//div[contains(@class, "mw-search-result-heading")]'): - results.append( - { - 'url': url + eval_xpath(result, './/a/@href')[0], - 'title': eval_xpath(result, './/a/text()')[0], - } - ) - return results |