Instagram APIを使用して、フォロワーと私がフォローしているすべての人のリストを取得しようとしています。私はフォロワーを獲得しようとする度に、私の応答はnullを返すと思います。私のフォロワーのリストを取得し、Instagram APIを使用して追跡
この私が取得エラーです:
未定義の
は、プロパティを読み取ることができません '長さ' これは
をresponse.data.lengthするための基準であるここに私のapp.jsです:
window.Instagram = { /** * Store application settings */ config: {}, BASE_URL: 'https://api.instagram.com/v1', init: function(opt) { opt = opt || {}; this.config.client_id = opt.client_id; }, /** * Get a list of popular media */ popular: function(callback) { var endpoint = this.BASE_URL + '/media/popular?client_id=' + this.config.client_id; this.getJSON(endpoint, callback); }, /** * Get a list of recently tagged media */ tagsByName: function(name, callback) { var endpoint = this.BASE_URL + '/tags/' + name + '/media/recent?client_id=' + this.config.client_id; this.getJSON(endpoint, callback); }, followers: function(callback) { var endpoint = this.BASE_URL + '/users/self/follows?access_token=' + this.config.access_token; this.getJSON(endpoint, callback); }, getJSON: function(url, callback) { $.ajax({ type: 'GET', url: url, dataType: 'jsonp', success: function(response) { if (typeof callback === 'function') callback(response); } }); } } Instagram.init({ client_id: 'CENSORED', access_token: 'CENSORED' }); $(document).ready(function() { Instagram.followers(function(response) { var $instagram = $('#instagram'); $instagram.append('<textarea cols="1" rows="' + response.data.length + '">') for (var i = 0; i < response.data.length; i++) { var name = response.data[i].username; $instagram.append(name + ' '); } $instagram.append('</textarea>'); }); });
リクエストステータスは何ですか?デベロッパーコンソールの[ネットワーク]タブでこれを確認できます。 –
ステータスコード200です。私はそれが良い印だと確信していますか? – Revoltechs