Skip to content

Instantly share code, notes, and snippets.

@codeincontext
Created November 15, 2011 00:38
Show Gist options
  • Select an option

  • Save codeincontext/1365709 to your computer and use it in GitHub Desktop.

Select an option

Save codeincontext/1365709 to your computer and use it in GitHub Desktop.
How many people are you following that aren't following you back on twitter
require 'twitter'
require 'redis'
Twitter.configure do |config|
config.consumer_key = CONSUMER_KEY
config.consumer_secret = CONSUMER_SECRET
config.oauth_token = TOKEN
config.oauth_token_secret = SECRET
end
friend_ids = Twitter.friend_ids('skattyadz')[:ids]
follower_ids = Twitter.follower_ids('skattyadz')[:ids]
puts "Following #{friend_ids.length}"
puts "Followed by #{follower_ids.length}"
non_following_friends = friend_ids - follower_ids
puts "Following but not followed back by #{non_following_friends.length}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment