Created
October 21, 2013 09:33
-
-
Save sindresorhus/7081125 to your computer and use it in GitHub Desktop.
Get recent photos from Instagram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRecentInstagramPhotos(userId, accessToken, count, cb) { | |
var url = 'https://api.instagram.com/v1/users/' + userId + '/media/recent?access_token=' + accessToken + '&count=' + count; | |
$.getJSON(url, function (response) { | |
cb(response.data); | |
}); | |
} | |
var userId = ''; | |
var accessToken = ''; | |
getRecentInstagramPhotos(userId, accessToken, 20, function (photos) { | |
console.log(photos[0].caption.text); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment