Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bturnbull/1002618 to your computer and use it in GitHub Desktop.
Save bturnbull/1002618 to your computer and use it in GitHub Desktop.
Quickly find out who among the people you follow are not following you back
require 'twitter'
# You'll need to get this info from your Twitter Developer account
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
# Grab a collection of ids for your friends and your followers
friends = Twitter.friend_ids.ids
followers = Twitter.follower_ids.ids
# screen_names is a collection of users who you are following but are not following you back
screen_names = Twitter.users(*(friends - followers)).map(&:screen_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment