开发者

Rails & Mogli - get users friends' ids

开发者 https://www.devze.com 2023-04-02 02:37 出处:网络
I\'m using Rails 3 & mogli to connect to facebook. This code get\'s me a user object. client = Mogli::Client.new(session[:at])

I'm using Rails 3 & mogli to connect to facebook. This code get's me a user object.

client = Mogli::Client.new(session[:at])
user = Mogli::User.find("me", client)

I've seen from the documentation that mogli has classes for all the object types. (EG: albums, events, etc) But i don't know how to retrieve connections. (EG: friends)

Basically i need to get a list of the user's friends with their id's. Because user.friends is only a开发者_Python百科n array of their names.

Any ideas?


err. i feel stupid. @user.friends is an array of Mogli::User objects. @user.friends.inpect was calling to_str on them automatically.

0

精彩评论

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

关注公众号