Hi guys! :)
I'm trying to display a number of recent photos from Instagram that have a certain tag (for example: "snow").
I have never done this before (and I have PHP and JSON knowledge equal to 0,1.. :P ) + saying that Instagram API's documentation is poor is a gift!!
Here's the code I'm trying..
Code: [Select]
Ehm.. (of course?) it doesn't work.. do you have an idea of what I need to change?
Thankssss ;)
EDIT: XXX is the client ID I have.
I'm trying to display a number of recent photos from Instagram that have a certain tag (for example: "snow").
I have never done this before (and I have PHP and JSON knowledge equal to 0,1.. :P ) + saying that Instagram API's documentation is poor is a gift!!
Here's the code I'm trying..
<?php
$json = file_get_contents('https://api.instagram.com/v1/tags/snow/media/recent?client_id=XXX');
$decode = json_decode($json, true);
var_dump($decode);
?>
<?php
foreach ($response['data'] as $data) {
$thumbnail = $data['images']['low_resolution']['url'];
$author = $data['caption']['from']['username'];
$date = $data['created_time'];
$text = $data['caption']['text'];
$link = $data['link']; }
?>
<div>
<a href="<?php $link ?>"><span></span><img src="<?php $thumbnail ?>" title="<?php $text ?>" alt="<?php $text ?>" /></a>
<div>via <?php $author ?> at <?php echo date("h:i:s A \o\\n d/m/Y",$date); ?></div>
<?php $text ?>
</div>Ehm.. (of course?) it doesn't work.. do you have an idea of what I need to change?
Thankssss ;)
EDIT: XXX is the client ID I have.







<br /><br />cough, cough.