Skip to content

Instantly share code, notes, and snippets.

@inlanger
Created November 15, 2013 10:33
Show Gist options
  • Save inlanger/7482344 to your computer and use it in GitHub Desktop.
Save inlanger/7482344 to your computer and use it in GitHub Desktop.
Get 9 latest photos from foursquare api for venue Need to register an app here - https://foursquare.com/oauth
$("#foursquare_photos").html('<h2>Loading photos...</h2>');
$.get("https://api.foursquare.com/v2/venues/VENUE_ID/photos?limit=9&client_id=ID&client_secret=SECRET&v=20131016", function (data) {
$("#foursquare_photos").html('');
$(data.response.photos.items).each(function (i, val) {
$("#foursquare_photos").append('<div class="fsphoto"><img src="' + val.prefix + '70x70' +val.suffix + '"></div>');
});
}, 'json');
#foursquare_photos {
width: 280px;
}
.fsphoto {
float: left;
magrin: 5px;
display: inline-block;
width: 80px;
height: 80px;
border: 3px solid #ffffff;
background-position: center center;
background-size: cover;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment