开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜