diff options
author | pw3t <romain@berthor.fr> | 2014-01-15 22:25:10 +0100 |
---|---|---|
committer | pw3t <romain@berthor.fr> | 2014-01-16 22:03:43 +0100 |
commit | a8ec7fe6a4ad86a8eea4aa6be441984bc5ef7e5a (patch) | |
tree | a9777dd3b432245996b3a64c7aa0d123d3fde987 /searx/engines/mediawiki.py | |
parent | fdb6fac214c2fb5bdc6c27492bc45c6694483fb4 (diff) | |
download | searxng-a8ec7fe6a4ad86a8eea4aa6be441984bc5ef7e5a.tar.gz searxng-a8ec7fe6a4ad86a8eea4aa6be441984bc5ef7e5a.zip |
[ehn] add favicons for vimeo, soundcloud, twitter and youtube
Diffstat (limited to 'searx/engines/mediawiki.py')
-rw-r--r-- | searx/engines/mediawiki.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py index d4b3fd843..19b4406b5 100644 --- a/searx/engines/mediawiki.py +++ b/searx/engines/mediawiki.py @@ -14,5 +14,13 @@ def request(query, params): def response(resp): search_results = loads(resp.text) res = search_results.get('query', {}).get('search', []) + return [{'url': url + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8')), 'title': result['title']} for result in res[:int(number_of_results)]] + + if not len(res): + return results + for result in res[:int(number_of_results)]: + results.append({'url': url + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8')), 'title': result['title'], 'favicon':'wikipedia'}) + return results + |