forked from cosenary/Instagram-PHP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Using Pagination
Rob W edited this page Mar 21, 2015
·
1 revision
Using the do-while loop, you can easily implement the pagination method on most API calls.
Get all users that user X follows:
$Instagram = new MetzWeb\Instagram\Instagram(array(
"apiKey" => IG_APP_KEY,
"apiSecret" => IG_APP_SECRET,
"apiCallback" => IG_APP_CALLBACK
));
$Instagram->setSignedHeader(true);
$followers = $Instagram->getUserFollows(123);
do {
// Process this batch of $followers
// <do something>
// Don't forget this pagination method or this will become an infinite loop!
$followers = $Instagram->pagination($followers);
} while ($followers);