diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2015-01-17 20:25:13 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2015-01-17 20:25:13 +0100 |
| commit | e3edded60f96aea7ce25465fd0dc49914d4fe9c8 (patch) | |
| tree | d67dd90de2b3983604e127c2c5e06de3aede9577 /searx/engines/bing_images.py | |
| parent | 975b6b5b09b8b6366dc3103d04ca3636da927ebe (diff) | |
| parent | d910744efe02f6eedb8fcb7661b208b349f78b39 (diff) | |
Merge pull request #178 from Cqoicebordel/thumbnails
Thumbnails
Diffstat (limited to 'searx/engines/bing_images.py')
| -rw-r--r-- | searx/engines/bing_images.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/engines/bing_images.py b/searx/engines/bing_images.py index 6c5e49bc9..9ae498427 100644 --- a/searx/engines/bing_images.py +++ b/searx/engines/bing_images.py @@ -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 |