MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/home/artinside/www/lhh/auth.php
<?php

require __DIR__ . "/vendor/autoload.php";
use EspressoDev\InstagramBasicDisplay\InstagramBasicDisplay;

$instagram = new InstagramBasicDisplay("IGQVJWMkJNakUyNVppcldnMU1WREdnclFmSGRFemVOYWxwazlqY1FKUURDOEdXSG1GQlB0azJYYnU3WDR2bTlGbUJIU0hCN3c5MGFsMDYtY1NOT29KemVhQTZAUU1JyQy1fbzFybU5R");

// Get the OAuth callback code
$code = $_GET["code"];
// Get the short lived access token (valid for 1 hour)
$token = $instagram->getOAuthToken($code, true);

// Exchange this token for a long lived token (valid for 60 days)
$token = $instagram->getLongLivedToken($token, true);

echo 'Your token is: ' . $token;

// Set user access token
$instagram->setAccessToken("IGQVJWMkJNakUyNVppcldnMU1WREdnclFmSGRFemVOYWxwazlqY1FKUURDOEdXSG1GQlB0azJYYnU3WDR2bTlGbUJIU0hCN3c5MGFsMDYtY1NOT29KemVhQTZAUU1JyQy1fbzFybU5R");

// Get the users profile
$profile = $instagram->getUserProfile();

echo '<pre>';
print_r($profile);
echo '<pre>';
$media = $instagram->getUserMedia("me", 1);
//var_dump($media);
$upload = new \Source\Support\Upload();
foreach ($media->data as $item) {
    if($item->media_type == "IMAGE"){

        echo "<img src='".$item->media_url."' width='500' height='500'>";
        $content = file_get_contents($item->media_url);
//Store in the filesystem.
        $fp = fopen("tmp/teste.jpg", "w");
        fwrite($fp, $content);
        fclose($fp);

    }

    //Get the file


}