简体   繁体   English

从Flickr公共帐户获取最新的12张照片

[英]Get the latest 12 photos from Flickr public account

I have an #images div that contain 12 tag, I want to fill these images with the latest 12 images from a Flickr account. 我有一个包含12个标签的#images div,我想用来自Flickr帐户的最新12张图像填充这些图像。 What is the code I need for this? 我需要什么代码?

First you will need the flickr id for the username you want to retrieve the images from. 首先,您将需要flickr ID作为您要从中检索图像的用户名。 You can find that using http://idgettr.com 您可以使用http://idgettr.com找到它

You can then use that, along with the JSON format and a JASONP callback to construct an URL, which you then pass to a $.getJSON() jquery function. 然后,您可以将其与JSON格式和JASONP回调一起使用以构造URL,然后将其传递给$ .getJSON()jquery函数。

an example taken from the book 'JavaScript & jQuery the missing manual' looks something like this 取自《 JavaScript和jQuery缺少手册》一书的示例看起来像这样

var flickrURL = "http://api.flickr.com/services/feeds/photos_public.gne?ids=userId&format=json&jsoncallback=?"
$.getJSON(flickrURL, function(data){
//do something with returned data
});//end get

as Ummar suggested, you will need to make a bit more of an effort yourself... Try searching for 'add a flickr feed to your website' to find some useful tutorials, and go from there. 正如Ummar所建议的那样,您需要自己付出更多的努力...尝试搜索“将flickr提要添加到您的网站”以找到一些有用的教程,然后从那里开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM