我有以下命令,它允许我在登录用户的facebook墙上发布一条消息:
$facebook->api("/$uid/feed", "POST", array('message' => 'Hello! I\'m using the FB Graph API!'));
即使用url https://graph.facebook.com/<user id goes here>/feed
但是,我需要输入什么命令才能获得已登录用户的朋友列表?
我需要使用的url是https://graph.facebook.com/me/friends
,但我不确定如何编辑以下命令来获取好友列表:
$facebook->api("/$uid/feed", "POST", array('message' => 'Hello! I\'m using the FB Graph API!'));
我应该做这样的事情吗(这完全是一个猜测)
$facebook->api("/$uid/friends", "GET", array('access_token' => 'token value goes here'));
或者我是不是应该做些别的事情来获取好友列表?
发布于 2011-04-29 04:39:24
SO上的这篇文章可能会提供你正在寻找的答案。您需要获取friends对象,然后在其上执行foreach循环以打印结果(如本文所述)。阅读Getting list of Facebook friends with latest API
https://stackoverflow.com/questions/5824271
复制相似问题