我一直在使用一些 Javascript 将我的 Instagram 提要拉入我的网站,但最近它完全停止了拉动,最近 Instagram 发生了一些变化,这可能是导致这种情况的原因吗?
我做了谷歌搜索,看看某处是否有变化,但似乎找不到任何东西
这是我正在使用的代码
$(function() {
var cmdURL, embedImage, onPhotoLoaded, param, tag_name, userid,
param = {
access_token: '3794301.f59def8.e08bcd8b10614074882b2d1b787e2b6f', // feel free to change it with your own access token
count: 10 // the total number of images
},
tag = 'Gezzamondoportfolio', // your user id. you can find this one out by looking into one of your pictures uri
tag_name = '#photowall',
cmdURL = 'https://api.instagram.com/v1/tags/' + tag + '/media/recent?callback=?';
embedImage = function(photo) {
var a, img;
img = $('<img/>').attr({
//'src': photo.images.thumbnail.url,
//'width': photo.images.thumbnail.width,
//'height': photo.images.thumbnail.height
'src': photo.images.standard_resolution.url,
'width': photo.images.standard_resolution.width,
'height': photo.images.standard_resolution.height
});
a = $('<a />').attr({
'href': photo.images.standard_resolution.url,
'target': '_blank',
'class': 'pull-left'
}).append(img).appendTo(tag_name);
};
onPhotoLoaded = function(data) {
var photo, _i, _len, _ref, _results;
if (data.meta.code === 200 && data.data) {
_ref = data.data;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
photo = _ref[_i];
_results.push(embedImage(photo));
}
return _results;
}
};
return $.getJSON(cmdURL, param, onPhotoLoaded);
});