Reputation: 51
i need to get instagram new followers using instagram API. I am able to get total friends but not able to get NEW followers. I have to get NEW followers.
$obj = new Instagram\Instagram;
$obj->setAccessToken($sKey1);
$_SESSION['Inst_'.$keys['AppKey']] = $obj;
$current_user = $_SESSION['Inst_'.$keys['AppKey']]->getCurrentUser();
$follows = $current_user->getFollows( isset( $_GET['follows_cursor'] ) ? array( 'cursor' => $_GET['follows_cursor'] ) : null );
$follows_count = $current_user->getFollowsCount();
How to get new followers not total followers?
Upvotes: 0
Views: 1834
Reputation: 46
As Rahul said, i haven´t find a clean way to detect if someone has follow my instagram account, but the algorithm recommended wouldn't work as expected.
I would recommend to store a list of followers, then (lets suppose 5 mins later) ask the api for a new list of followers and compare if you have someone new. Because, only by checking the number of followers you would be missing new followers, a good example would be if at the same time someone follows and another one unfollows. Hope this helps. I dont know about PHP but PYTHON has a nice built in function to compare lists.
Upvotes: 1
Reputation: 61
I think there is no direct method but you can try this algorithm.
Upvotes: 0