mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 18:12:21 +02:00
[fix] pep/flake8 compatibility
This commit is contained in:
parent
692c0bf5f0
commit
b2492c94f4
23 changed files with 197 additions and 109 deletions
|
@ -6,12 +6,14 @@ from json import loads
|
|||
categories = ['images']
|
||||
|
||||
url = 'https://ajax.googleapis.com/'
|
||||
search_url = url + 'ajax/services/search/images?v=1.0&start=0&rsz=large&safe=off&filter=off&{query}'
|
||||
search_url = url + 'ajax/services/search/images?v=1.0&start=0&rsz=large&safe=off&filter=off&{query}' # noqa
|
||||
|
||||
|
||||
def request(query, params):
|
||||
params['url'] = search_url.format(query=urlencode({'q': query}))
|
||||
return params
|
||||
|
||||
|
||||
def response(resp):
|
||||
results = []
|
||||
search_res = loads(resp.text)
|
||||
|
@ -24,5 +26,9 @@ def response(resp):
|
|||
title = result['title']
|
||||
if not result['url']:
|
||||
continue
|
||||
results.append({'url': href, 'title': title, 'content': '', 'img_src': result['url'], 'template': 'images.html'})
|
||||
results.append({'url': href,
|
||||
'title': title,
|
||||
'content': '',
|
||||
'img_src': result['url'],
|
||||
'template': 'images.html'})
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue