Chris Johnson
2009-Feb-24 02:42 UTC
[Facebooker-talk] Retrieving an array of users given an array of uid''s
Hi there. Let''s say I have a list of 20 uids (call it "cool_friends"). These are friends of the current user, and I''d like to retrieve User objects for each friend (so that I can access first_name and last_name). I know I could do something like: facebook_session.user.friends!(:uid, :first_name, :last_name) With that full friend list, I can iterate over it and match users to the list of "cool_friends", but that seems cumbersome and pulls back more users (all friends) than I need. Can I request an array of users based on a list of UIDs? Cheers, Chris
kevin lochner
2009-Feb-24 03:51 UTC
[Facebooker-talk] Retrieving an array of users given an array of uid''s
facebook_session.users(ids, fields) On Feb 23, 2009, at 9:42 PM, Chris Johnson wrote:> Hi there. > > Let''s say I have a list of 20 uids (call it "cool_friends"). These > are friends of the current user, and I''d like to retrieve User > objects for each friend (so that I can access first_name and > last_name). > > I know I could do something like: > facebook_session.user.friends!(:uid, :first_name, :last_name) > > With that full friend list, I can iterate over it and match users to > the list of "cool_friends", but that seems cumbersome and pulls back > more users (all friends) than I need. > > Can I request an array of users based on a list of UIDs? > > Cheers, > Chris > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Chris Johnson
2009-Feb-28 03:30 UTC
[Facebooker-talk] Retrieving an array of users given an array of uid''s
That worked perfectly. Thanks Kevin for your reply. -Chris On Feb 23, 2009, at 7:51 PM, kevin lochner wrote:> facebook_session.users(ids, fields) > > > On Feb 23, 2009, at 9:42 PM, Chris Johnson wrote: > >> Hi there. >> >> Let''s say I have a list of 20 uids (call it "cool_friends"). These >> are friends of the current user, and I''d like to retrieve User >> objects for each friend (so that I can access first_name and >> last_name). >> >> I know I could do something like: >> facebook_session.user.friends!(:uid, :first_name, :last_name) >> >> With that full friend list, I can iterate over it and match users >> to the list of "cool_friends", but that seems cumbersome and pulls >> back more users (all friends) than I need. >> >> Can I request an array of users based on a list of UIDs? >> >> Cheers, >> Chris >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >