summaryrefslogtreecommitdiff
path: root/searx/engines/bing.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2014-01-29 21:14:38 +0100
committerasciimoo <asciimoo@gmail.com>2014-01-29 21:14:38 +0100
commitca271fd8617db722015f629832ed44a845ab73ed (patch)
tree089fa18e2de62e444d6638c823baedf8ce434860 /searx/engines/bing.py
parent8bb94e3dc4c35042ec5fb16f412331f4b8ca6c8a (diff)
downloadsearxng-ca271fd8617db722015f629832ed44a845ab73ed.tar.gz
searxng-ca271fd8617db722015f629832ed44a845ab73ed.zip
[enh] bing, google paging support
Diffstat (limited to 'searx/engines/bing.py')
-rw-r--r--searx/engines/bing.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/searx/engines/bing.py b/searx/engines/bing.py
index c4b945633..ec8a0c44c 100644
--- a/searx/engines/bing.py
+++ b/searx/engines/bing.py
@@ -3,13 +3,17 @@ from urllib import urlencode
from cgi import escape
base_url = 'http://www.bing.com/'
-search_string = 'search?{query}'
+search_string = 'search?{query}&first={offset}'
locale = 'en-US' # see http://msdn.microsoft.com/en-us/library/dd251064.aspx
+paging = True
+
def request(query, params):
+ offset = (params['pageno'] - 1) * 10 + 1
search_path = search_string.format(
- query=urlencode({'q': query, 'setmkt': locale}))
+ query=urlencode({'q': query, 'setmkt': locale}),
+ offset=offset)
#if params['category'] == 'images':
# params['url'] = base_url + 'images/' + search_path
params['url'] = base_url + search_path