2013-04-25 35 views
0

我一直在使用一些JavaScript來拉我的Instagram飼料到我的網站,但最近它完全停止拉動,最近有什麼改變與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); 
}); 

回答

0

看起來你去了你請求每小時限制。我訪問這個鏈接,並得到了以下錯誤:https://api.instagram.com/v1/tags/Gezzamondoportfolio/media/recent?callback=?&access_token=3794301.f59def8.e08bcd8b10614074882b2d1b787e2b6f

{"code": 420, "error_type": "OAuthRateLimitException", "error_message": "You have exceeded the maximum number of requests per hour. You have performed a total of 345 requests in the last hour. Our general maximum request limit is set at 30 requests per hour."} 
+0

我根本沒有訪問這個feed,所以我怎麼會超過每小時的請求呢?你能看到其他可能導致此問題突然停止的問題嗎 – 2013-05-05 14:04:05

+0

你從哪裏得到這個訪問令牌?這是你的,還是你在別的地方? – Nate 2013-05-06 06:22:32

+0

認爲我可能在其他地方找到了它,我會在哪裏獲得我自己的訪問令牌? – 2013-05-11 10:35:33

2

我今天早些時候有同樣的問題(與PHP,不jQuery的/ JSON)。 我發現,顯然Instagram的feed已經改變了。要獲取圖像源,我發現:

'src': photo.images.standard_resolution 

寬度和高度不再提供。

+0

現在,Instagram的飼料是回到以前的結構。 – tryoruda 2013-04-26 13:03:31

+0

我仍然無法將我的feen拉入網頁。任何其他想法? – 2013-05-05 14:02:17