我想在PHP、JS或ObjC中使用Bing图像API,但是像http://msdn.microsoft.com/en-us/library/dd250939.aspx这样的类和属性似乎只能在C#或VB中使用,对吗?
我只想得到图像搜索的JSON结果,指定宽度和高度.从GET url看来是不可能的: api.bing.net/xml.aspx?Appid=XXXXXXXXXXXXXXXXXXXXX&query=sushi&sources=image我尝试插入&size=small或&width=300,但没有发送任何更改。
我可以在ObjC iOS和http://ibing.codeplex.com/中使用API实现宽度和高度属性,但只是作为响应信息,而不是请求参数。
发布于 2012-03-15 13:08:13
我就是这样做的:
函数getOnePageUrls($querystr,$country= "com“,$page=1) { $markets =$page=1(”com“=> "en-US”、"co.uk“=> "en-GB”、"ru“=> "ru-RU”、"de“”=>“DE-DE、"fr”=> "fr-FR“、"es”“=> "es-ES”);$market = $markets$country;if ($page==1) $offset = 0;$offset = (($page-1)*50)+1;$appID = "XXXXXXXXXXXXXXXXXXXXXXXXX";//必应应用程序ID $searchstr = "http://api.search.live.net/json.aspx?Appid=$appID&query=$querystr&sources=web&market=$market&web.count=50&web.offset=$offset";$json = file_get_contents($searchstr);$results = json_decode($json);$results =$Results->SearchResponse->Web->$response>Web-> $response;foreach ($results as $result) { $response[] =$Results->DisplayUrl;}Report$response;}
就这样!:-)
https://stackoverflow.com/questions/9719084
复制相似问题