summaryrefslogtreecommitdiff
path: root/searx/engines/mediawiki.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-01-30 01:44:12 +0100
committerasciimoo <asciimoo@gmail.com>2014-01-30 01:44:12 +0100
commit35ecb6ec5d650aebb4acadd5fc5542b3fc7d81dd (patch)
tree2176483542feb51998847b603b18eeaace67da65 /searx/engines/mediawiki.py
parent81b4cc77da21e694230307745f589b6e8c88f962 (diff)
downloadsearxng-35ecb6ec5d650aebb4acadd5fc5542b3fc7d81dd.tar.gz
searxng-35ecb6ec5d650aebb4acadd5fc5542b3fc7d81dd.zip
[enh] paging support for mediawiki
Diffstat (limited to 'searx/engines/mediawiki.py')
-rw-r--r--searx/engines/mediawiki.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py
index bc4aab6df..f8cfb9afa 100644
--- a/searx/engines/mediawiki.py
+++ b/searx/engines/mediawiki.py
@@ -3,13 +3,15 @@ from urllib import urlencode, quote
url = 'https://en.wikipedia.org/'
-search_url = url + 'w/api.php?action=query&list=search&{query}&srprop=timestamp&format=json' # noqa
+search_url = url + 'w/api.php?action=query&list=search&{query}&srprop=timestamp&format=json&sroffset={offset}' # noqa
number_of_results = 10
def request(query, params):
- params['url'] = search_url.format(query=urlencode({'srsearch': query}))
+ offset = (params['pageno'] - 1) * 10
+ params['url'] = search_url.format(query=urlencode({'srsearch': query}),
+ offset=offset)
return params