Skip to content

Instantly share code, notes, and snippets.

Created September 10, 2015 02:58
What would you like to do?
instagram image feed on your website
<div class="instram-container">
$user_id = "xxxxxxxxxx"; //userid
$num_to_display = "8"; //instagram limits to max 20, but you can do less for your layout.
$access_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // access token
<div class="instagram-block"></div>
<script type="text/javascript">
$(function() {
type: "GET",
dataType: "jsonp",
cache: false,
url: "<?=$user_id?>/media/recent/?access_token=<?=$access_token?>",
success: function(data) {
for (var i = 0; i < <?=$num_to_display?>; i++) {
$(".instagram-block").append("<ul><li><a target='_blank' href='" +[i].link +"'><img height='227' width='242' class='instagram-image' src='" +[i].images.low_resolution.url +"' /></a></li></ul>");}
<div class="clear"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment