searching friends using facebook graph api
Does facebook have an api for 开发者_JAVA百科searching a user's friend?
Tim
You can search friend's name like this:
select uid, name, sex
from user
where uid in (SELECT uid2 FROM friend WHERE uid1 = me())
and (strpos(lower(name),'TheFriendName')>=0 OR strpos(name,'TheFriendName')>=0)
TheFriendName=Full name or part of the name
Example:
select uid, name, sex
from user
where uid in (SELECT uid2 FROM friend WHERE uid1 = me())
and (strpos(lower(name),'Jack')>=0 OR strpos(name,'Jack')>=0)
You can get the list of friends using the following API call:
Friends: https://graph.facebook.com/me/friends?access_token=...
and then search in the list for the person you are looking for.
Refer to more detailed documentation here: http://developers.facebook.com/docs/api
精彩评论