PHP code example of ideato / instagram-feed

1. Go to this page and download the library: Download ideato/instagram-feed 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/ */

    

ideato / instagram-feed example snippets


    $instagramFeed = new InstagramFeed\InstagramFeed(
        new \GuzzleHttp\Client(),
        'your own access token'
    );
    
    $media = $instagramFeed->getMedia(); //will returns array of InstagramFeed\Model\Media objects

    $instagramFeed = new InstagramFeed\InstagramFeed(
        new \GuzzleHttp\Client(),
        'your own access token'
    );
    
    $instagramCachedFeed = new InstagramFeed\InstagramCachedFeed(
        new \Symfony\Component\Cache\Adapter\FilesystemAdapter(),
        $instagramFeed,
        $ttl //defaults to 600 seconds
    );
    
    $media = $instagramCachedFeed->getMedia(); //will returns array of InstagramFeed\Model\Media objects

    $this->get('app.instagram_cached_feed')->getMedia();