我正在实现用于图像搜索的 Bing
搜索。
我引用了 this链接,并将我的响应更改为 JSON
。
它起作用了,结果是这样的:
{
"d": {
"results": [{
"__metadata": {
"uri": "https://api.datamarket.azure.com/Data.ashx/Bing/Search/Image?Query=\u0027Pepsi\u0027&$skip=0&$top=1",
"type": "ImageResult"
},
"ID": "64737694-fc53-4d68-933d-10edc214fd3a",
"Title": "Pepsi: Like Madonna, its look has been reinvented time and time again ...",
"MediaUrl": "http://tjthesportsgeek.files.wordpress.com/2012/02/pepsi.png",
"SourceUrl": "http://tjthesportsgeek.com/2012/02/14/tale-of-the-tape-coke-vs-pepsi/",
"DisplayUrl": "tjthesportsgeek.com/2012/02/14/tale-of-the-tape-coke-vs-pepsi",
"Width": "1588",
"Height": "2064",
"FileSize": "569827",
"ContentType": "image/png",
"Thumbnail": {
"__metadata": {
"type": "Bing.Thumbnail"
},
"MediaUrl": "http://ts2.mm.bing.net/th?id=OIP.M7f9b9a39639b9ca8bb6f1cba6e35d041H0&pid=15.1",
"ContentType": "image/jpg",
"Width": "369",
"Height": "480",
"FileSize": "19879"
}
},
// Next array element
]
}
}
但我需要的是:
json
结果只有 MediaUrl 和 Thumbnail 的 MediaUrl。 (因为在 Google 自定义搜索中可以借助标签“field”,例如 fields=items(link,image/thumbnailLink))只有中等大小的图像。 (我搜索了这个并应用了过滤器但没有用。)
请回复您的宝贵建议。
最佳答案
- 您不能过滤输出字段。
- 使用参数:ImageFilters = Size.Medium
我的引用:https://onedrive.live.com/view.aspx?resid=9C9479871FBFA822!109&app=Word&authkey=!ACvyZ_MNtngQyCU
关于Android:必应图片搜索结果自定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32472948/