Exemplo n.º 1
0
    foreach ($feed->data as $item) {
        ?>
        <li>
            ID: <?php 
        echo $item->id;
        ?>
<br />
            <img src="<?php 
        echo $item->images->low_resolution->url;
        ?>
" alt="" /><br />
            By: <?php 
        echo $item->user->username;
        ?>
        </li>
    <?php 
    }
    ?>
    </ul>
<?php 
}
?>

<?php 
try {
    // Like or unlike a photo
    $instagram->post('media/SOME-ID-HERE/likes');
    //$instagram->delete('media/SOME-ID-HERE/likes');
} catch (InstagramApiError $e) {
    die($e->getMessage());
}