티스토리 뷰

DailyStep/IT

Instagram API 와 Instafeed.js

jSoboro 2015. 2. 13. 16:02

Instagram API 사용하기

 * 공식 https://www.instagram.com/developer/

 * 예제 포스팅 http://dreamofblue.tistory.com/93


Instafeed.js <= 이게 짱인듯.

 * 오픈소스 js api http://instafeedjs.com/


public_content Scope 의 access_token 을 얻는 url

 * https://api.instagram.com/oauth/authorize/?client_id=YOUR-CLIENT-ID&redirect_uri=YOUR-REDIRECT-URI&response_type=token&scope=public_content


Instafeed.js 사용 예시

    var feed = new Instafeed({

accessToken: 'xxxxxxxx.yyyyyyyy.zzzzzzzzzzzzzzzzzzzzz',

get: 'user',

        userId: '4224063xx',

limit: '20',

resolution: 'standard_resolution',

filter: function(image) {

image.template = '<img src="' + image.images.standard_resolution.url + '" />';

return true;

},

template: '<div id="{{model.id}}"><br /><div style="float:center;">{{caption}}</div><br /><br /></div>',

after: function() {

$("video").each(function(index,element){

this.load();

});

}

    });


$(document).ready(function() {

// Run Instafeed

feed.run();

    });