Created
October 10, 2013 14:45
-
-
Save pomartel/6919555 to your computer and use it in GitHub Desktop.
Get list of facebook friends that are also using the application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@participants = Participant.where("facebook_uid IN (?)", connected_friends).order('id DESC') | |
def connected_friends | |
graph = Koala::Facebook::API.new(get_user_oauth_token) | |
friends = graph.get_connections("me", "friends", fields: 'installed') | |
friends.collect do |f| | |
f["installed"] == true ? f["id"] : nil | |
end.compact | |
rescue => e | |
notify_honeybadger_or_ignore e | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment