1
0
mirror of https://github.com/searx/searx synced 2024-12-12 00:45:18 +01:00

[fix] pep8 fix for faroo engine

This commit is contained in:
misnyo 2017-08-30 19:48:57 +02:00 committed by Adam Tauber
parent 0607b167f8
commit 20d2d4dab1

View File

@ -24,12 +24,12 @@ number_of_results = 10
# search-url
url = 'http://www.faroo.com/'
search_url = url + 'instant.json?{query}'\
'&start={offset}'\
'&length={number_of_results}'\
'&l={language}'\
'&src={categorie}'\
'&i=false'\
'&c=false'
'&start={offset}'\
'&length={number_of_results}'\
'&l={language}'\
'&src={categorie}'\
'&i=false'\
'&c=false'
search_category = {'general': 'web',
'news': 'news'}
@ -79,16 +79,15 @@ def response(resp):
# parse results
for result in search_res['results']:
publishedDate = None
result_json = {'url': result['url'],
'title': result['title'],
'content': result['kwic']}
result_json = {'url': result['url'], 'title': result['title'],
'content': result['kwic']}
if result['news']:
result_json['publishedDate'] = \
datetime.datetime.fromtimestamp(result['date'] / 1000.0)
datetime.datetime.fromtimestamp(result['date'] / 1000.0)
# append image result if image url is set
if result['iurl']:
result_json['template'] ='videos.html'
result_json['template'] = 'videos.html'
result_json['thumbnail'] = result['iurl']
results.append(result_json)