如何通过json检索flickr图像的图像描述
检索图像,
http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=***&photoset_id=72157625776815845&extras=original_format&format=json&jsoncallback=?
我正在使用以下 json url 从 flickr Response
jsonFlickrApi({"photoset":{"id":"72157625776815845", "primary":"5386650651", "owner":"58668842@N05", "ownername":"mohanramphp", "photo":[{"id":"5386650651", "secret":"fcfc73c14f", "server":"5214", "farm":6, "title":"image5", "isprimary":"1"}, {"id":"5387254114", "secret":"76e63d565e", "server":"5215", "farm":6, "title":"image4", "isprimary":"0"}, {"id":"5386650273", "secret":"2f0d19575a", "server":"5214", "farm":6, "title":"image3", "isprimary":"0"}, {"id":"5387253836", "secret":"66f2ec20a7", "server":"5214", "farm":6, "title":"image2", "isprimary":"0"}, {"id":"5387253676", "secret":"f159c8d52a", "server":"5212", "farm":6, "title":"image1", "isprimary":"0"}], "page":1, "per_page":500, "perpage":500, "pages":1, "total":"5"}, "stat":"ok"})
我还需要通过 json 获取图像描述。我不知道该怎么办。我尝试了 flickr 提供的所有 json url。如果有任何 flickr json 来检索图像描述我自己也知道。
I am using Following json url to retrieve images from flickr
http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=***&photoset_id=72157625776815845&extras=original_format&format=json&jsoncallback=?
Response
jsonFlickrApi({"photoset":{"id":"72157625776815845", "primary":"5386650651", "owner":"58668842@N05", "ownername":"mohanramphp", "photo":[{"id":"5386650651", "secret":"fcfc73c14f", "server":"5214", "farm":6, "title":"image5", "isprimary":"1"}, {"id":"5387254114", "secret":"76e63d565e", "server":"5215", "farm":6, "title":"image4", "isprimary":"0"}, {"id":"5386650273", "secret":"2f0d19575a", "server":"5214", "farm":6, "title":"image3", "isprimary":"0"}, {"id":"5387253836", "secret":"66f2ec20a7", "server":"5214", "farm":6, "title":"image2", "isprimary":"0"}, {"id":"5387253676", "secret":"f159c8d52a", "server":"5212", "farm":6, "title":"image1", "isprimary":"0"}], "page":1, "per_page":500, "perpage":500, "pages":1, "total":"5"}, "stat":"ok"})
I need to fetch image description also via json. I don't know how to do. I tried all json url provided by flickr. If there is any flickr json to retrieve image description intimate myself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要获得标题,您需要做的是:
或在 jQuery 中:
然后对于描述,请使用 http://www.flickr.com/services/api/flickr.photos.getInfo.html
photos.getInfo(一个额外的 API 调用)并以这种方式从每张图片中检索描述
What you have to do to get the title is:
or in jQuery:
and then for the description, use the process outlined in http://www.flickr.com/services/api/flickr.photos.getInfo.html
photos.getInfo (an additional API call) and retrieve the description from each picture that way
您可以查看此工作示例。
You can check this working sample.