PHP code example of noxzemart / rt-instagram-sdk-php
1. Go to this page and download the library: Download noxzemart/rt-instagram-sdk-php 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/ */
//Login
$instagram->login("username", "password");
//Serialize the Session into a JSON string
$savedSession = $instagram->saveSession();
//Store $savedSession in Database, or Cookie etc
//Load $savedSession from Database or Cookie etc
$savedSession = ...;
//Init from Saved Session
$instagram->initFromSavedSession($savedSession);
//Session is Restored, do something!
$instagram-> ...;
//Get TimelineFeed
$timelineFeed = $instagram->getTimelineFeed();
//This will be null if there are no more pages.
$nextMaxId = $timelineFeed->getNextMaxId();
//We have another page of Items
if($nextMaxId != null){
//Get the next page.
$timelineFeed = $instagram->getTimelineFeed($nextMaxId);
}