views:

46

answers:

1

If I have in my web application a facebook user logged in. I want then to be able to post to his friends sth on their new's feed. For this I need an ID of his friend that i want to post to.(at least I think I should need an id or maybe there is some other way).

So the question is how to get the ID's of his friends. I can get all the names of his friends with facebook_user.friends. Or i can also get the first one with facebook_user.friends.first.

So the question is how to get the ID of a specific friend depending on his/her name?

I was searching google and reading through the facebook documentation but couldn't find anything so I would appreciate any answer. Thank you.

(I am using facebooker2 and mogli gem to interact with posting to walls etc.)

A: 

Calling http://graph.facebook.com/youruser/friends will return all of the user's friends data. Of course you will need the correct extended permissions as well as a valid auth token.

marcgg
thank you for answering! I can get the friends yes but is there an option like http://graph.facebook.com/youruser/friends/"Johnny Boy". So that I can get a particular user?
necker
@necker: no, you'll have to get all the friends and then filter
marcgg
I am using facebooker2 and mogli gem. And I can get the names with current_facebook_user.friends . I am not sure how can I call an internet address http://graph.facebook.com/youruser/friends within my view or controller. I also do not know how can I apply any filters to it then? I read the fb documentation up and down and tried their console with examples but still i cant get it working. Could you maybe provide any example for rails or how do you do it? You can just paste your code if you have some and I'll figure it out. Big thanks for answering again.
necker