mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 10:02:20 +02:00
[fix] pep/flake8 compatibility
This commit is contained in:
parent
692c0bf5f0
commit
b2492c94f4
23 changed files with 197 additions and 109 deletions
|
@ -3,8 +3,9 @@ from urllib import urlencode
|
|||
|
||||
url = 'http://api.duckduckgo.com/?{query}&format=json&pretty=0&no_redirect=1'
|
||||
|
||||
|
||||
def request(query, params):
|
||||
params['url'] = url.format(query=urlencode({'q': query}))
|
||||
params['url'] = url.format(query=urlencode({'q': query}))
|
||||
return params
|
||||
|
||||
|
||||
|
@ -13,11 +14,10 @@ def response(resp):
|
|||
results = []
|
||||
if 'Definition' in search_res:
|
||||
if search_res.get('AbstractURL'):
|
||||
res = {'title' : search_res.get('Heading', '')
|
||||
,'content' : search_res.get('Definition', '')
|
||||
,'url' : search_res.get('AbstractURL', '')
|
||||
,'class' : 'definition_result'
|
||||
}
|
||||
res = {'title': search_res.get('Heading', ''),
|
||||
'content': search_res.get('Definition', ''),
|
||||
'url': search_res.get('AbstractURL', ''),
|
||||
'class': 'definition_result'}
|
||||
results.append(res)
|
||||
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue