开发者

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 + 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜