如何让Facebook喜欢Facebook的Facebook页面? [英] How to get Facebook likes count for a Facebook page?
问题描述
我正在向Facebook图形API发出GET请求,例如:
I am making GET request to Facebook graph API like:
https://graph.facebook.com/Yahoo?fields=likes
它正在返回喜欢 count,即使我没有登录。
It is returning the likes count even if I am not logged in.
但是对于像 https://graph.facebook.com/CaraSutrasPage?fields=likes
我没有得到Facebook喜欢当我没有登录。这里的原因是,这个Facebook页面是年龄限制的。
I am NOT getting the Facebook likes when I am not logged-in. The reason here is, this Facebook page is age-restricted.
从这个问题,我尝试将用户 access_token 如:
From this question, I tried including the User access_token like: https://graph.facebook.com/CaraSutrasPage?fields=likes&access_token=CAAGRLGYz...User_access_token
但这只有在该用户登录到developer.facebook.com网站时才有效。退出后,它返回验证访问令牌时出错:这可能是因为用户注销或可能是由于系统错误。
消息。
But this works only when that user is logged into developer.facebook.com site. After logged-out it is returning "Error validating access token: This may be because the user logged out or may be due to a system error."
message.
我想让Facebook喜欢Facebook页面网址列表(例如 https://www.facebook.com/TheRedheadBedhead 和 https ://www.facebook.com/pages/Sexational/382577001850507?ref = hl ),它们存储在数据库中。我不知道哪些是年龄限制的,哪些不是!
I want to get the Facebook likes for a list of Facebook page URLs(e.g. https://www.facebook.com/TheRedheadBedhead and https://www.facebook.com/pages/Sexational/382577001850507?ref=hl) which are stored in database. I have not idea about which are age-restricted and which are not!
有没有办法如果我可以使用 FQL ?
Is there any way if I can get the likes count using FQL?
我正在寻找一种方式来获取Facebook喜欢任何方法:GET请求(例如 https://graph.facebook.com/CaraSutrasPage ?fields = likes ),POST请求或FQL!
I am looking for a way to get the facebook likes by any method: GET request(e.g. https://graph.facebook.com/CaraSutrasPage?fields=likes), POST request or FQL!
任何帮助都非常感谢!
推荐答案
你可以简单地点击URL并传递你的pageId和令牌
You can simply hit the url and pass your pageId and token
https://graph.facebook.com/<YOUR_PAGE_NAME>/?fields=fan_count&access_token=<YOUR_ACCESS_TOKEN>
它将返回一个Json对象。
It will return a Json object.
这篇关于如何让Facebook喜欢Facebook的Facebook页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!