Javascript 如何添加我的photostream?

Javascript 如何添加我的photostream?,javascript,jquery,flickr,photostream,Javascript,Jquery,Flickr,Photostream,我想将我的photostream添加到我的网站。我已经尝试了多段代码 (找不到设置的id) 及 jQuery.getJSON(“http://api.flickr.com/services/feeds/groups_pool.gne?id=675729@N22&lang=en-us&format=json&jsoncallback=?”,函数(数据){ jQuery.each(data.items,function(i,item){ jQuery(“ 假设我需要找到id将公共提要添加到我的pho

我想将我的photostream添加到我的网站。我已经尝试了多段代码

(找不到设置的id)

jQuery.getJSON(“http://api.flickr.com/services/feeds/groups_pool.gne?id=675729@N22&lang=en-us&format=json&jsoncallback=?”,函数(数据){
jQuery.each(data.items,function(i,item){
jQuery(“
假设我需要找到id将公共提要添加到我的photostream

编辑此选项似乎有效,但会抛出一个403

<script>
jQuery(function(){
    var apikey = 'xxxxxxx';
    var userid = 'xxxxxx';
    jQuery.getJSON('http://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key='+apikey+'&user_id='+userid+'&format=json&jsoncallback=?',
    function(data){
       jQuery.each(data.photos.photo, function(i,item){
            var purl = 'http://farm' + item.farm + '.static.flickr.com/' + item.server + '/' + item.id + '_' + item.secret + '_m.jpg';
            var pid = item.id;
            var container = '<div class="image-container" style="background: url(' + purl+ ');"></div>';
           jQuery(container).appendTo('#images');
        });
    });
});
</script>

jQuery(函数(){
变量apikey='xxxxxxx';
var userid='xxxxxx';
jQuery.getJSON('http://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key=“+apikey+”&user_id=”+userid+”&format=json&jsoncallback=?”,
功能(数据){
jQuery.each(data.photos.photo,函数(i,项){
var purl='1〕http://farm'+item.farm+'.static.flickr.com/'+item.server+'/'+item.id+'.''.'+item.secret+'.\u m.jpg';
var pid=item.id;
var容器=“”;
jQuery(container).appendTo(“#images”);
});
});
});

这项工作只需将图像设置为public即可。

我已经获取了您在下面发布的确切代码,并将其应用于JSFIDLE

jQuery.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?id=675729@N22&lang=en-us&format=json&jsoncallback=?", function(data){
  jQuery.each(data.items, function(i,item){
    jQuery("<img/>").attr("src", item.media.m).appendTo("#images")
      .wrap("<a href='" + item.link + "'></a>");
  });
});
jQuery.getJSON(“http://api.flickr.com/services/feeds/groups_pool.gne?id=675729@N22&lang=en-us&format=json&jsoncallback=?”,函数(数据){
jQuery.each(data.items,function(i,item){
jQuery(“

图像返回正确,链接也正常工作,我想您应该检查页面上是否有一个ID为“images”的div,并且没有其他导致页面出错的javascript


通过在您选择的浏览器中使用开发人员工具并查看控制台来检查这一点。

您收到的问题是什么?这里没有问题?这对我有效?错误是什么?是的,但它不会添加我的流-假设我问的是如何查找我的photostream ID。您如何编辑您的问题以实际解释这是什么问题?
jQuery.getJSON("http://api.flickr.com/services/feeds/groups_pool.gne?id=675729@N22&lang=en-us&format=json&jsoncallback=?", function(data){
  jQuery.each(data.items, function(i,item){
    jQuery("<img/>").attr("src", item.media.m).appendTo("#images")
      .wrap("<a href='" + item.link + "'></a>");
  });
});