I am trying to do Instagram user Follow and Unfollow from my site. I am using Instagram API+ codeignator to do this. In front end, i am listing instagram users with a "Follow" & "Following" button. When user is following and they click on "Following" it should "Unfollow" user. When button shows "Follow" and user clicks on it, the button should change to following and start following user. I am adding code that i did:
$follow_id =$_POST['id'];
$accessToken = @$this->session->userdata('instagram_accessTokeninst');
$url= 'https://api.instagram.com/v1/users/'.$follow_id.'/relationship?access_token='.$accessToken;
$data = 'action=follow';
$resultObj = json_decode(sendPostData($url,$data));
print_r($resultObj);
$responseCode = $resultObj->meta->code;
$errorMsg = $resultObj->meta->error_message;
As a response to this, I am getting an "Internal Server error". Is this code fine for my requirement. Waiting for your answers...
Instagram now requires that you request special permission from them in order to follow users using their API. So you will not be able to follow/unfollow a user with the API until Instagram grants you these permissions.
Here is where you request access: https://help.instagram.com/contact/185819881608116
FYI, here are guidelines from Instagram about requesting these permissions: "The ability to POST and DELETE likes, follows and comments is restricted to applications that offer business services and not consumer facing apps."
Unfollow Instagram users using browser console:
Enter this code:
setInterval(
function(){
var arr = document.getElementsByClassName("_0mzm- sqdOP L3NKy _8A5w5 ");
for (var i = 1, len = arr.length; i < len; i++) {
arr[i].click();
document.getElementsByClassName("aOOlW -Cab_ ")[0].click();
}
var scroll_stuff = document.getElementsByClassName("isgrP")[0];
scroll_stuff.scrollTop = scroll_stuff.scrollHeight;
}
, 600000); //every 10 minutes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With