@@ -3,13 +3,17 @@ from urllib import urlencode
33from cgi import escape
44
55base_url = 'http://www.bing.com/'
6−search_string = 'search?{query}'
6+search_string = 'search?{query}&first={offset}'
77locale = 'en-US' # see http://msdn.microsoft.com/en-us/library/dd251064.aspx
88
9+paging = True
10+
911
1012def request(query, params):
13+ offset = (params['pageno'] - 1) * 10 + 1
1114 search_path = search_string.format(
12− query=urlencode({'q': query, 'setmkt': locale}))
15+ query=urlencode({'q': query, 'setmkt': locale}),
16+ offset=offset)
1317 #if params['category'] == 'images':
1418 # params['url'] = base_url + 'images/' + search_path
1519 params['url'] = base_url + search_path