开发者

Omniauth + Facebook Mutual Friends Count

开发者 https://www.devze.com 2023-04-05 16:50 出处:网络
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)Y

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

精彩评论

暂无评论...
验证码 换一张
取 消