forked from zaclys/searxng
add tags as suggestions
This commit is contained in:
parent
d22f469010
commit
79d06509c1
@ -34,9 +34,9 @@ def request(query, params):
|
||||
def response(resp):
|
||||
results = []
|
||||
|
||||
json_results = loads(resp.text)['data']['posts']
|
||||
json_results = loads(resp.text)['data']
|
||||
|
||||
for result in json_results:
|
||||
for result in json_results['posts']:
|
||||
result_type = result['type']
|
||||
|
||||
if result_type == 'Photo':
|
||||
@ -63,4 +63,8 @@ def response(resp):
|
||||
}
|
||||
)
|
||||
|
||||
if 'tags' in json_results:
|
||||
for suggestion in json_results['tags']:
|
||||
results.append({'suggestion': suggestion['key']})
|
||||
|
||||
return results
|
||||
|
Loading…
Reference in New Issue
Block a user