|
@@ -4,7 +4,8 @@
|
4
|
4
|
@using-api yes
|
5
|
5
|
@results JSON
|
6
|
6
|
@stable yes
|
7
|
|
- @parse url, content, size, abstract, author, mtype, time, filename, label
|
|
7
|
+ @parse url, content, size, abstract, author, mtype, time, \
|
|
8
|
+ filename, label
|
8
|
9
|
"""
|
9
|
10
|
|
10
|
11
|
from json import loads
|
|
@@ -39,10 +40,12 @@ def get_time_range(time_range):
|
39
|
40
|
# do search-request
|
40
|
41
|
def request(query, params):
|
41
|
42
|
search_after = get_time_range(params['time_range'])
|
42
|
|
- search_url = base_url + 'json?query={query}&page={page}&after={after}&dir={dir}&highlight=0'
|
43
|
|
-
|
44
|
|
- params['url'] = search_url.format(query=urlencode({'q': query}), page=params['pageno'],
|
45
|
|
- after=search_after, dir=search_dir)
|
|
43
|
+ search_url = base_url + 'json?{query}&highlight=0'
|
|
44
|
+ params['url'] = search_url.format(query=urlencode({
|
|
45
|
+ 'query': query,
|
|
46
|
+ 'page': params['pageno'],
|
|
47
|
+ 'after': search_after,
|
|
48
|
+ 'dir': search_dir}))
|
46
|
49
|
|
47
|
50
|
return params
|
48
|
51
|
|