Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
Created October 21, 2013 09:33
Show Gist options
  • Save sindresorhus/7081125 to your computer and use it in GitHub Desktop.
Save sindresorhus/7081125 to your computer and use it in GitHub Desktop.
Get recent photos from Instagram
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