mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 18:12:21 +02:00
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 ?
This commit is contained in:
parent
edd9d31180
commit
cb4a3fe598
9 changed files with 44 additions and 8 deletions
|
@ -25,6 +25,7 @@ paging = True
|
|||
# search-url
|
||||
base_url = 'https://www.bing.com/'
|
||||
search_string = 'images/search?{query}&count=10&first={offset}'
|
||||
thumb_url = "http://ts1.mm.bing.net/th?id={ihk}"
|
||||
|
||||
|
||||
# do search-request
|
||||
|
@ -63,6 +64,8 @@ def response(resp):
|
|||
yaml_data = load(p.sub(r'\1\2: \3', link.attrib.get('m')))
|
||||
|
||||
title = link.attrib.get('t1')
|
||||
ihk = link.attrib.get('ihk')
|
||||
|
||||
#url = 'http://' + link.attrib.get('t3')
|
||||
url = yaml_data.get('surl')
|
||||
img_src = yaml_data.get('imgurl')
|
||||
|
@ -72,6 +75,7 @@ def response(resp):
|
|||
'url': url,
|
||||
'title': title,
|
||||
'content': '',
|
||||
'thumbnail_src': thumb_url.format(ihk=ihk),
|
||||
'img_src': img_src})
|
||||
|
||||
# TODO stop parsing if 10 images are found
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue