Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
73ec2ba7
Commit
73ec2ba7
authored
Dec 19, 2018
by
Léo Bourrel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update bing image engine with new image json format
parent
442772a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
bing_images.py
searx/engines/bing_images.py
+1
-3
test_bing_images.py
tests/unit/engines/test_bing_images.py
+3
-3
No files found.
searx/engines/bing_images.py
View file @
73ec2ba7
...
...
@@ -88,9 +88,7 @@ def response(resp):
url
=
json_data
.
get
(
'purl'
)
img_src
=
json_data
.
get
(
'murl'
)
thumb_json_data
=
loads
(
_quote_keys_regex
.
sub
(
r'\1"\2": \3'
,
link
.
attrib
.
get
(
'mad'
)))
thumbnail
=
thumb_json_data
.
get
(
'turl'
)
thumbnail
=
json_data
.
get
(
'turl'
)
# append result
results
.
append
({
'template'
:
'images.html'
,
...
...
tests/unit/engines/test_bing_images.py
View file @
73ec2ba7
...
...
@@ -52,7 +52,7 @@ class TestBingImagesEngine(SearxTestCase):
<li>
<div>
<div class="imgpt">
<a m='{"purl":"page_url","murl":"img_url"
}' mad='{
"turl":"thumb_url"}'>
<a m='{"purl":"page_url","murl":"img_url"
,
"turl":"thumb_url"}'>
<img src="" alt="alt text" />
</a>
</div>
...
...
@@ -60,7 +60,7 @@ class TestBingImagesEngine(SearxTestCase):
</div>
<div>
<div class="imgpt">
<a m='{"purl":"page_url2","murl":"img_url2"
}' mad='{
"turl":"thumb_url2"}'>
<a m='{"purl":"page_url2","murl":"img_url2"
,
"turl":"thumb_url2"}'>
<img src="" alt="alt text 2" />
</a>
</div>
...
...
@@ -71,7 +71,7 @@ class TestBingImagesEngine(SearxTestCase):
<li>
<div>
<div class="imgpt">
<a m='{"purl":"page_url3","murl":"img_url3"
}' mad='{
"turl":"thumb_url3"}'>
<a m='{"purl":"page_url3","murl":"img_url3"
,
"turl":"thumb_url3"}'>
<img src="" alt="alt text 3" />
</a>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment