PHP code example of bnomei / kirby3-instagram

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

    

bnomei / kirby3-instagram example snippets


return [
    // other config settings ...
    'bnomei.instagram.token' => 'YOUR-TOKEN-HERE',
];

return [
    // other config settings ...
    'bnomei.instagram.token' => function() { return env('INSTAGRAM_TOKEN'); },
];


    // default. this will cause loading from the config file or set it here...
    $token = null; 
    $token = 'YOUR-TOKEN-HERE';
    $endpoint = 'users/self/media/recent';
    $params = [
        'count' => 4
    ];
    $force = null; // default. this will cause refresh on global debug == true
    // $force = true; // always force refresh
    foreach(site()->instagram($token, $endpoint, $params, $force) as $data) {
        echo Kirby\Toolkit\Html::img(
            $data['images']['standard_resolution']['url']
        );
    }

$inst = new Bnomei\Instagram([
    'token' => null,
    'api' => 'https://repo.packagist.org/',
    'endpoint' => 'p/bnomei/kirby3-instagram.json',
    'json-root' => 'packages',
]);
$data = $inst->api()['bnomei/kirby3-instagram']['1.2.0']['authors'][0]['name'];
// Bruno Meilick