Skip to content

Instantly share code, notes, and snippets.

@coreyweb
Created October 28, 2014 17:44
Show Gist options
  • Save coreyweb/241c8485fcc8978b0520 to your computer and use it in GitHub Desktop.
Save coreyweb/241c8485fcc8978b0520 to your computer and use it in GitHub Desktop.
<div class="row">
<h3>My Pictures</h3>
<?php
$json = file_get_contents('https://api.instagram.com/v1/users/[YOUR_USER_ID]/media/recent?access_token=[YOUR_ACCESS_TOKEN]&count=5');
$data = json_decode($json);
foreach ($data->data as $key=>$value) {
?>
<a href="<?php echo $value->link ?>" target="_blank">
<img src="<?php echo $value->images->thumbnail->url ?>" title="<?php echo $value->caption->text ?>" alt="<?php echo $value->caption->text ?>">
</a>
<?php
}
?>
</div><!-- .row -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment