diff options
| -rw-r--r-- | searx/engines/digg.py | 69 | ||||
| -rw-r--r-- | searx/settings.yml | 7 | ||||
| -rw-r--r-- | utils/brand.env | 4 | ||||
| -rwxr-xr-x | utils/lib_nvm.sh | 13 |
4 files changed, 10 insertions, 83 deletions
diff --git a/searx/engines/digg.py b/searx/engines/digg.py deleted file mode 100644 index e12cc43c8..000000000 --- a/searx/engines/digg.py +++ /dev/null @@ -1,69 +0,0 @@ -# SPDX-License-Identifier: AGPL-3.0-or-later -# lint: pylint -""" - Digg (News, Social media) -""" - -from json import loads -from urllib.parse import urlencode -from datetime import datetime - -from lxml import html - -# about -about = { - "website": 'https://digg.com', - "wikidata_id": 'Q270478', - "official_api_documentation": None, - "use_official_api": False, - "require_api_key": False, - "results": 'HTML', -} - -# engine dependent config -categories = ['news', 'social media'] -paging = True -base_url = 'https://digg.com' - -# search-url -search_url = base_url + ( - '/api/search/' - '?{query}' - '&from={position}' - '&size=20' - '&format=html' -) - -def request(query, params): - offset = (params['pageno'] - 1) * 20 - params['url'] = search_url.format( - query = urlencode({'q': query}), - position = offset, - ) - return params - -def response(resp): - results = [] - - # parse results - for result in loads(resp.text)['mapped']: - - # strip html tags and superfluous quotation marks from content - content = html.document_fromstring( - result['excerpt'] - ).text_content() - - # 'created': {'ISO': '2020-10-16T14:09:55Z', ...} - published = datetime.strptime( - result['created']['ISO'], '%Y-%m-%dT%H:%M:%SZ' - ) - results.append({ - 'url': result['url'], - 'title': result['title'], - 'content' : content, - 'template': 'videos.html', - 'publishedDate': published, - 'thumbnail': result['images']['thumbImage'], - }) - - return results diff --git a/searx/settings.yml b/searx/settings.yml index 825392525..4802fbd72 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -408,10 +408,6 @@ engines: # timeout: 6.0 # disabled: true - - name: digg - engine: digg - shortcut: dg - - name: docker hub engine: docker_hub shortcut: dh @@ -803,7 +799,6 @@ engines: - name: library genesis engine: xpath - enable_http: true search_url: https://libgen.rs/search.php?req={query} url_xpath: //a[contains(@href,"bookfi.net/md5")]/@href title_xpath: //a[contains(@href,"book/")]/text()[1] @@ -1144,8 +1139,6 @@ engines: engine: reddit shortcut: re page_size: 25 - timeout: 10.0 - disabled: true # Required dependency: redis # - name: myredis diff --git a/utils/brand.env b/utils/brand.env index 7c38364d6..31afce53c 100644 --- a/utils/brand.env +++ b/utils/brand.env @@ -1,5 +1,5 @@ export SEARXNG_URL='' export SEARXNG_PORT='8888' export SEARXNG_BIND_ADDRESS='127.0.0.1' -export GIT_URL='https://github.com/return42/searxng' -export GIT_BRANCH='doc-theme' +export GIT_URL='https://github.com/searxng/searxng' +export GIT_BRANCH='master' diff --git a/utils/lib_nvm.sh b/utils/lib_nvm.sh index c12be05cf..d35abef2a 100755 --- a/utils/lib_nvm.sh +++ b/utils/lib_nvm.sh @@ -120,14 +120,17 @@ nvm.install() { nvm.clean() { if ! nvm.is_installed; then - info_msg "NVM is not installed" - return 42 + build_msg CLEAN "[NVM] not installed" + return fi if ! nvm.is_local; then - info_msg "can't remove NVM from ${NVM_DIR}" - return 42 + build_msg CLEAN "[NVM] can't remove nvm from ${NVM_DIR}" + return + fi + if [ -n "${NVM_DIR}" ]; then + build_msg CLEAN "[NVM] drop $(realpath --relative-to=. "${NVM_DIR}")/" + rm -rf "${NVM_DIR}" fi - rm -rf "${NVM_DIR}" } nvm.status(){ |