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

2k Views Asked by At

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.

2

There are 2 best solutions below

0
On

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/

1
On

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.