PHP code example of bramdeleeuw / silverstripe-instagram

1. Go to this page and download the library: Download bramdeleeuw/silverstripe-instagram library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bramdeleeuw / silverstripe-instagram example snippets


$member = Security::getCurrentUser();
$instagram = new \Broarm\Instagram\InstagramClient($member->InstagramAccessToken);
 
// Get the media from the user connected to the access token
$instagram->getUserMedia();

// Get the media for the given user id
$instagram->getUserMedia($member->InstagramID); 

// The above calls return a simple array with media id's 
// Use this call to get the media for the given id
$instagram->getMedia($id);