我只需要也喜欢 facebook 页面的用户 friend 数。我已经为此制作了一个 Facebook 应用程序。用户应该已经转到该应用程序,以便我们可以收到用户详细信息。
然后我们使用 FQL 运行查询
SELECT uid FROM page_fan WHERE page_id = 'Page Id' AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
但它只显示访问该应用并喜欢该页面的 friend 列表。我还需要那些喜欢该页面但不使用该应用程序的 friend 。
这可能吗?
最佳答案
如果您使用的应用具有 Graph API v2.0 或更高版本,则无法再通过 FQl 获取。
您可以使用新的 Social Context API,它应该可以提供您想要的信息(普通用户数)。看看 https://developers.facebook.com/docs/graph-api/reference/v2.0/page.context/friends_who_like
示例请求:
GET /{Page_ID}?fields=context{friends_who_like}
将生成如下输出:
{
"context": {
"friends_who_like": {
"data": [
{
"id": "8490902464564645645",
"name": "Friend 1"
}
],
"paging": {
"cursors": {
"before": "ODQ5MDkwMjQ2",
"after": "ODQ5MDkwMjQ2"
}
},
"summary": {
"social_sentence": "4 of your friends like this.",
"total_count": 4
}
}
},
"id": "40796308305"
}
属性 context.friends_who_like.summary.total_count
将包含喜欢示例可口可乐页面 (ID 40796308305) 的好友总数。
关于php - 如何让用户 friend 统计谁也喜欢 Facebook 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25883383/