Is there a better/easier way to find mutual friends between users than creating a Friends table and logging the UIDs of each new user's friends? (Using Devise + O开发者_如何学JAVAmniauth on Rails 3)
You dont need to log all UIDs. Are you using facebook provider ? If so, you can use Koala or FBGraph gems to form an FQL to find of there are any common friends.
If you already have the oauth_access_token
available, you can use the koala gem.
@graph = Koala::Facebook::API.new(oauth_access_token)
friends = @graph.get_connections("me", "friends")
精彩评论