在Facebook(PHP)中检索朋友的朋友列表(Retrieve list of my friends' friend's in Facebook (PHP))

编程入门 行业动态 更新时间:2024-10-21 05:55:26
在Facebook(PHP)中检索朋友的朋友列表(Retrieve list of my friends' friend's in Facebook (PHP))

我试着得到朋友朋友的名单。 由于他们已将我添加为朋友,因此我可以访问他们的朋友列表(朋友列表无论如何都可以公开访问)。

但是当我尝试通过API完成它时,我收到一个错误:

{"error":{"type":"OAuthException","message":"(#604) Can't lookup all friends of 100001150965395. Can only lookup for the logged in user (508424886), or friends of the logged in user with the appropriate permission"}}

有没有其他方法可以查找列表(没有他特别授予应用程序的权限)?

我正在使用的代码是:

<? $a=$cookie['access_token']; $url='https://graph.facebook.com/100001150965395/friends?access_token='.$a; $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); echo $output;

I am try to get a list of my friends' friend's. As they have added me as a friend, I am able to access their friends lists(friend lists are publicly accessible anyways).

but when I try to do it through the API, I get an error:

{"error":{"type":"OAuthException","message":"(#604) Can't lookup all friends of 100001150965395. Can only lookup for the logged in user (508424886), or friends of the logged in user with the appropriate permission"}}

Is there any other way I can look up the list(without him specifically granting permission to the app)?

code that I am using is:

<? $a=$cookie['access_token']; $url='https://graph.facebook.com/100001150965395/friends?access_token='.$a; $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); echo $output;

最满意答案

Facebook中有隐私设置,可以将朋友列表限制为仅限朋友。 由于您的应用不是您尝试访问的用户ID的朋友,因此您受到限制。 您可以通过在新的浏览器窗口(新会话)中尝试配置文件URL来检查它。 看起来有问题的用户ID无法访问好友列表。

http://www.facebook.com/profile.php?id=100001150965395

There is privacy setting in Facebook which can restrict Friends list to Friends alone. Since your app is not a Friend of the user id you are trying to access, you are restricted. You can check it by trying the profile URL in a new browser window (fresh session). It looks like the user id in question have prevented access to Friend's list.

http://www.facebook.com/profile.php?id=100001150965395

更多推荐

本文发布于:2023-08-04 03:32:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1405914.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:朋友   列表   PHP   Facebook   friend

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!