summaryrefslogtreecommitdiff
path: root/searx/engines/google_images.py
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-17 19:21:09 +0100
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-17 19:21:09 +0100
commitcb4a3fe598707fc42f86ea3f7bcf517dcd4db660 (patch)
treef5ee1ea08f2b491c58806e236664c23389b8ff21 /searx/engines/google_images.py
parentedd9d311809d8f6eab5109f9cd899e7989bb42d5 (diff)
downloadsearxng-cb4a3fe598707fc42f86ea3f7bcf517dcd4db660.tar.gz
searxng-cb4a3fe598707fc42f86ea3f7bcf517dcd4db660.zip
Add thumbnails in images results
- Modify engines to create/fetch an URL for the thumbnails - Modify themes to show thumbnails instead of full images. In Courgette, the result is not very beautiful. Should we change it ?
Diffstat (limited to 'searx/engines/google_images.py')
-rw-r--r--searx/engines/google_images.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
index 79fac3fb0..c08279660 100644
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -43,15 +43,18 @@ def response(resp):
# parse results
for result in search_res['responseData']['results']:
+ print result
href = result['originalContextUrl']
title = result['title']
if not result['url']:
continue
+ thumbnail_src = result['tbUrl']
# append result
results.append({'url': href,
'title': title,
'content': '',
+ 'thumbnail_src': thumbnail_src,
'img_src': unquote(result['url']),
'template': 'images.html'})