PHP code example of alterebro / instagram-feed

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

    

alterebro / instagram-feed example snippets




use Alterebro\InstagramFeed;

$feed = new InstagramFeed(
    $query,     // i.e: "@alterebro"
    $cachePath  // i.e: __DIR__ . "/tmp/"
);
$feed->JSON();

// Retrive 10 items from user @alterebro and stores it on the /tmp/ folder for 12 hours / half day (43200 seconds)
$feed = new InstagramFeed('@alterebro', '/tmp/', 10, 43200);

// Get the data :
$data = $feed->load();

// or Output as JSON :
$feed->JSON();