summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorpw3t <romain@berthor.fr>2014-01-13 22:24:05 +0100
committerpw3t <romain@berthor.fr>2014-01-16 22:03:43 +0100
commitfdb6fac214c2fb5bdc6c27492bc45c6694483fb4 (patch)
tree98e9ed98db33ea1f0254ee731d762b907e988f9a /searx/webapp.py
parentcf8f444e8597bf527ef4bfc691b6d45d5704f77f (diff)
[ehn] Add possibility to add icon in results (more ugly html / css, need fix)
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 72395709c..5fc981a89 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -140,9 +140,14 @@ def index():
else:
result['pretty_url'] = result['url']
- if 'wikipedia' in result['engines'] or 'ddg definitions' in result['engines']:
- featured_results.append(result)
- results.remove(result)
+ for engine in result['engines']:
+ if engine in ['wikipedia']:
+ result['favicon'] = engine
+ featured_results.append(result)
+ results.remove(result)
+ elif engine in ['ddg definitions']:
+ featured_results.append(result)
+ results.remove(result)
if request_data.get('format') == 'json':
return Response(json.dumps({'query': query, 'results': results}), mimetype='application/json')