Closed yigitkeremoktay closed 3 years ago
@yigitkeremoktay - this should help get you going in the right direction
$instagram = new Instagram();
$instagram->login($ig_username, $ig_password);
$user_session = $instagram->client->getSession();
$user = $user_session->getUser();
$user_id = $user->getId();
$users = [];
while($followers->getNextMaxId())
{
foreach($followers->getUsers() as $follower)
{
$users[] = [
'id' => $follower->getId(),
'username' => $follower->getUsername(),
'full_name' => $follower->getFullName(),
'photo_url' => $follower->getProfilePictureUrl(),
'anon_photo' => $follower->hasAnonymousProfilePicture()
];
}
$followers->next();
}
// Get the last page's results
foreach($followers->getUsers() as $follower)
{
$users[] = [
'id' => $follower->getId(),
'username' => $follower->getUsername(),
'full_name' => $follower->getFullName(),
'photo_url' => $follower->getProfilePictureUrl(),
'anon_photo' => $follower->hasAnonymousProfilePicture()
];
}
`
Where did the $followers
variable come from @mferrara ?
Oops, missed a line :D It's below, should come before the while loop.
// Get the followers for this user id
$followers = $instagram->followers($user_id);
Thanks!
Hello,
I want to quickly get the following and follower count but there is no documentation to help me.