Android:Bing图片搜索结果自定义

时间:2015-09-09 07:04:45

标签: android json api bing bing-api

我正在实施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

    ]
}
}

但我需要的是:

  1. json结果只有ThumbU的MediaUrl和MediaUrl。 (因为在Google自定义搜索中可以使用标记“字段”的帮助,例如fields = items(link,image / thumbnailLink))

  2. 图片仅为中等大小。 (我搜索了这个并应用了过滤器但没有用。)

  3. 请回复您的宝贵建议。

1 个答案:

答案 0 :(得分:1)

  1. 您无法过滤输出字段。
  2. 使用参数:ImageFilters = Size.Medium
  3. 我的参考:https://onedrive.live.com/view.aspx?resid=9C9479871FBFA822!109&app=Word&authkey=!ACvyZ_MNtngQyCU