This gem is an incredibly ligh-weight wrapper for finding how many facebook friends and twitter followers someone has.
gem 'social_count' # In your Gemfile
$ gem install social_count # Install locally
-
Configure your credentials:
SocialCount.credentials = SocialCount::Credentials.new
SocialCount.credentials.twitter_consumer_key SocialCount.credentials.twitter_consumer_secret SocialCount.credentials.twitter_oauth_token SocialCount.credentials.twitter_oauth_token_secret SocialCount.credentials.fb_app_id SocialCount.credentials.fb_app_secret
-
Get the Facebook follower count of any business page:
SocialCount::FacebookUser.new('zuck').follower_count # Find out how many people are following Mark Zuckerberg SocialCount::FacebookUser.new('zuck').friend_count # nil -- Mark has a business page because he's so famous
-
Get the Facebook friend count of any regular facebook user:
SocialCount::FacebookUser.new('jose.valim').friend_count # Find out how many friends Jose Valim has -- I wish he were as famous as Mark SocialCount::FacebookUser.new('jose.valim').follower_count # nil
-
Get the Twitter follower count of any user:
SocialMedia::TwitterUser.new('tsa').follower_count # Find out how many people are following the Transportation security Administration
-
Check if someone is on Facebook:
orwell = SocialCount::FacebookUser.new('george_orwell') orwell.valid? # False -- Not everyone is cool enough to be one Facebook orwell.friend_count # nil
-
Check if someone is on Twitter:
nsa = SocialCount::TwitterUser.new('no_such_agency') nsa.valid? # False -- Nobody can follow the NSA nsa.follower_count # nil