Skip to content

Instantly share code, notes, and snippets.

@pomartel
Created October 10, 2013 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pomartel/6919555 to your computer and use it in GitHub Desktop.
Save pomartel/6919555 to your computer and use it in GitHub Desktop.
Get list of facebook friends that are also using the application
@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