logo

searx

Unnamed repository; edit this file 'description' to name the repository.
commit: 467ab3791f4363c3a7e5cb70acf326729a595486
parent: 47a23898b35fc65280d399bb9cd43e3633e79079
Author: Adam Tauber <asciimoo@gmail.com>
Date:   Tue, 14 Jan 2014 02:25:53 -0800

Merge pull request #21 from dnet/master

Simplified MediaWiki response processing

Diffstat:

searx/engines/mediawiki.py | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py @@ -13,11 +13,6 @@ def request(query, params): def response(resp): search_results = loads(resp.text) - results = [] res = search_results.get('query', {}).get('search', []) - 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']}) - return results - + return [{'url': url + 'wiki/' + quote(result['title'].replace(' ', '_').encode('utf-8')), + 'title': result['title']} for result in res[:int(number_of_results)]]