|
@@ -74,8 +74,17 @@ def response(resp):
|
74
|
74
|
for result in search_results[0].get('items', []):
|
75
|
75
|
# parse image results
|
76
|
76
|
if result.get('image'):
|
|
77
|
+
|
|
78
|
+ result_url = ''
|
|
79
|
+ if 'url' in result:
|
|
80
|
+ result_url = result['url']
|
|
81
|
+ elif 'link' in result:
|
|
82
|
+ result_url = result['link']
|
|
83
|
+ else:
|
|
84
|
+ continue
|
|
85
|
+
|
77
|
86
|
# append result
|
78
|
|
- results.append({'url': result['url'],
|
|
87
|
+ results.append({'url': result_url,
|
79
|
88
|
'title': result['title'],
|
80
|
89
|
'content': '',
|
81
|
90
|
'img_src': result['image'],
|