This is just not working for me

8 views
Skip to first unread message

babake

unread,
Aug 18, 2011, 5:59:20 AM8/18/11
to facebooker, bmus...@hotmail.com
I see that facebook graph API only gives me about 25 friends by
default with User.find("me/friends"). I need to access the ids of all
friends and wanted to use the FetchingArray of Mogli, but I just
cannot put it together. Could anyone please help with any code snippet
that could, given an authenticated user, provide me with access to the
ids of all friends in increments so I can process them in a loop? If
Mike still hangs around here, your help will be appreciated.
Thanks

bolade mustapha

unread,
Aug 18, 2011, 6:13:28 AM8/18/11
to faceb...@googlegroups.com

 
> Date: Thu, 18 Aug 2011 02:59:20 -0700
> Subject: This is just not working for me
> From: babak...@gmail.com
> To: faceb...@googlegroups.com
> CC: bmus...@hotmail.com

Mike Mangino

unread,
Aug 18, 2011, 9:01:12 AM8/18/11
to faceb...@googlegroups.com

Odd, I don't see that result. Are you passing in a client?

When I run Mogli::Client.find("me/friends",client) for a user with 738 friends, I get data or all of them back.

Mike

--
Mike Mangino
http://www.elevatedrails.com

babake2000

unread,
Aug 18, 2011, 10:14:51 AM8/18/11
to faceb...@googlegroups.com
Hi Mike,
 I was wondering myself until I read something on facebook that said they may only return a subset of the results and you may need to page through for more, so I thought that is what the FetchingArray in Mogli was for. Ad I just couldn't figure out a way to use it. Here s the snippet of my code:
 
@friends = Mogli::User.find("me/friends", client) unless(client.blank?)
spawn do
@friends.map(&:id).each do |friend|
......some stuff e.g output the IDs
 
end
end
 
I have authorized a user with about 500 friends, and I got back only 25 IDs and even a user with 27 friends gave back 25 IDs as well.
 
Will it help if I could know how to use the FetchingArray such that I intentionally limit to 25 at one time? I tried also without having the processing in a spawned child just in case child was loosing facebook session, but it didn't give all the friends either.
 
 


 



--
You received this message because you are subscribed to the Google Groups "facebooker" group.
To post to this group, send email to faceb...@googlegroups.com.
To unsubscribe from this group, send email to facebooker+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/facebooker?hl=en.


Reply all
Reply to author
Forward
0 new messages