Twitter REST api: How to get all the users not following back?
Asked Answered
A

2

8

given the Twitter api call limitations, how to get a complete list of all the users not following you back? There are so many methods (friendship lookups, followers and following lists) that I don't know how to do this in the most efficient way.

Thanks.

Arcade answered 19/5, 2015 at 9:10 Comment(2)
What do you mean by "not following you back". As I know, you can only find out your followers/friend. If what you're mean is someone that you have follow but not following you back than you can just compare your follower and your following list.Allopatric
you need to do a little of logic, that endpoint does not exist.El
A
13

You can use this to find your followers : https://api.twitter.com/1.1/followers/ids.json?screen_name=your_screen_name

You can use this to find your following : https://api.twitter.com/1.1/friends/ids.json?screen_name=your_screen_name

And finally compare both Json data and the one that you are following but not in followers list is your not following back list of data.

Not following back = following - followers. You will need to use php or any language that you are comfortable with or making your application with to do the math for you.

Ambrosio answered 2/5, 2016 at 21:28 Comment(1)
hi, I have a question on your solution. I have read the API Reference Document, it shows the APIs you mentioned are all rate limited. followers/ids can be called 15 times in 15 mins, with maximum 5000 ids response, as the same as friends/ids. if you exceed the limits, you will get a eror response. So, we can get 750,000 ids in 15 mins, both followers and friends. if a user have more than 750,000 followers and friends, we can not get the 'not following back' immediately, we should wait 15 mins after every 15 calls to get all ids to get result. Do you have any suggestion on this issue? robyRent
C
2

Whilst not using the Twitter API, there is a really easy way to do this just using the Javascript console in a web browser.

  1. Open the Javascript console in your browser's developer tools
  2. Scroll to the bottom of the page using the below code

setInterval(function() { window.scrollTo(0, document.body.scrollHeight); }, 2000);
  1. Use this code to automatically unfollow anyone who doesn't follow you

$('.ProfileCard-content').each(function(){
var status = $(this).find('.FollowStatus').text();
var unfollowButton = $(this).find('.user-actions-follow-button');
if(!status){unfollowButton.click();
}});

Sorry as I know this doesn't involve the Twitter API, but thought I'd post it here as it is a solution.

Courtesy of https://realsocialseo.com/unfollow-twitter-users-dont-follow-back/

Coh answered 24/11, 2018 at 21:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.