简体   繁体   English

通过PHP代码获取喜欢Facebook帖子的人

[英]get who likes facebook post by php code

i want to get who like facebook post then and store it in php variable ... then look for specific name i want 我想得到像Facebook帖子那样的人,然后将其存储在php变量中...然后寻找我想要的特定名称

if it is about facebook photo i can use this 如果是关于facebook的照片,我可以用这个

$url = 'graph.facebook.com/photoid'

and then i use the code 然后我使用代码

file_get_contents($url);

and then search about the name who liked the photo 然后搜索喜欢这张照片的名字

but in post there is no graph to get who like post i tried to put the whole link like 但是在帖子中没有图可以让谁喜欢帖子我试图将整个链接放在

$url = ' https://www.facebook.com/AmrKhaled/posts/10152183719946165 ' $ url =' https://www.facebook.com/AmrKhaled/posts/10152183719946165 '

and then i use the code 然后我使用代码

file_get_contents($url);

but not found the name ... and if i var_dump($filegetcontent) and search my self no name is found 但没有找到名称...并且如果我var_dump($ filegetcontent)并搜索我自己,则找不到名称

i need to know who like my post by php code ?? 我需要通过PHP代码知道谁喜欢我的帖子? thanks 谢谢

The problem is not the user agent because you shouldn't be scraping the page. 问题不在于用户代理,因为您不应该抓取页面。

The id in that post is at the end 该帖子中的ID位于结尾

http://graph.facebook.com/10152183719946165

You just need a valid access token to retrieve it. 您只需要一个有效的访问令牌即可检索它。

To read a Page you need: 要阅读页面,您需要:

  • an app or user access token for public and non-demographically restricted pages 公共或不受人口限制的页面的应用或用户访问令牌
  • a user access_token for restricted pages that the current user is able to view (no special permissions required) 用户access_token用于当前用户可以查看的受限页面(不需要特殊权限)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM