neon
neon

Reputation: 2821

Omniauth + Facebook Mutual Friends Count

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 + Omniauth on Rails 3)

Upvotes: 2

Views: 736

Answers (2)

siong1987
siong1987

Reputation: 1053

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")

Upvotes: 0

ddb
ddb

Reputation: 1406

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.

Upvotes: 1

Related Questions