|
@@ -54,12 +54,12 @@ def request(query, params):
|
54
|
54
|
def response(resp):
|
55
|
55
|
results = []
|
56
|
56
|
|
57
|
|
- raw_search_results = loads(resp.text)
|
|
57
|
+ response_json = loads(resp.text)
|
58
|
58
|
|
59
|
|
- if not raw_search_results:
|
|
59
|
+ if not response_json:
|
60
|
60
|
return []
|
61
|
61
|
|
62
|
|
- for result in raw_search_results.get('results', []):
|
|
62
|
+ for result in response_json.get('results', []):
|
63
|
63
|
title = result['label']
|
64
|
64
|
url = result['url'].replace('file:///export', dl_prefix)
|
65
|
65
|
content = u'{}'.format(result['snippet'])
|
|
@@ -79,4 +79,6 @@ def response(resp):
|
79
|
79
|
|
80
|
80
|
results.append(item)
|
81
|
81
|
|
|
82
|
+ results.append({'number_of_results': response_json['nres']})
|
|
83
|
+
|
82
|
84
|
return results
|