summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authormisnyo <misnyo@misnyo.eu>2017-08-30 16:47:56 +0200
committermisnyo <misnyo@misnyo.eu>2017-08-30 16:47:56 +0200
commitf139f9cfdbc8d77eb61724eca253dc1e6ad72ce7 (patch)
treeabda8d9d01f546efbf0e118d712dde07a9a5b4f2 /searx
parent700baf2178d5970cef7cd1efaf24522a458a6b55 (diff)
downloadsearxng-f139f9cfdbc8d77eb61724eca253dc1e6ad72ce7.tar.gz
searxng-f139f9cfdbc8d77eb61724eca253dc1e6ad72ce7.zip
[mod]blekko images removed
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/blekko_images.py70
-rw-r--r--searx/settings.yml6
2 files changed, 0 insertions, 76 deletions
diff --git a/searx/engines/blekko_images.py b/searx/engines/blekko_images.py
deleted file mode 100644
index f71645634..000000000
--- a/searx/engines/blekko_images.py
+++ /dev/null
@@ -1,70 +0,0 @@
-"""
- Blekko (Images)
-
- @website https://blekko.com
- @provide-api yes (inofficial)
-
- @using-api yes
- @results JSON
- @stable yes
- @parse url, title, img_src
-"""
-
-from json import loads
-from searx.url_utils import urlencode
-
-# engine dependent config
-categories = ['images']
-paging = True
-safesearch = True
-
-# search-url
-base_url = 'https://blekko.com'
-search_url = '/api/images?{query}&c={c}'
-
-# safesearch definitions
-safesearch_types = {2: '1',
- 1: '',
- 0: '0'}
-
-
-# do search-request
-def request(query, params):
- c = (params['pageno'] - 1) * 48
-
- params['url'] = base_url +\
- search_url.format(query=urlencode({'q': query}),
- c=c)
-
- if params['pageno'] != 1:
- params['url'] += '&page={pageno}'.format(pageno=(params['pageno'] - 1))
-
- # let Blekko know we wan't have profiling
- params['cookies']['tag_lesslogging'] = '1'
-
- # parse safesearch argument
- params['cookies']['safesearch'] = safesearch_types.get(params['safesearch'], '')
-
- return params
-
-
-# get response from search-request
-def response(resp):
- results = []
-
- search_results = loads(resp.text)
-
- # return empty array if there are no results
- if not search_results:
- return []
-
- for result in search_results:
- # append result
- results.append({'url': result['page_url'],
- 'title': result['title'],
- 'content': '',
- 'img_src': result['url'],
- 'template': 'images.html'})
-
- # return results
- return results
diff --git a/searx/settings.yml b/searx/settings.yml
index 4da96b5bf..7822c6483 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -647,12 +647,6 @@ engines:
shortcut : 1337x
disabled : True
-#The blekko technology and team have joined IBM Watson! -> https://blekko.com/
-# - name : blekko images
-# engine : blekko_images
-# locale : en-US
-# shortcut : bli
-
# - name : yacy
# engine : yacy
# shortcut : ya