问题描述
如何获取在外部网站上单击了赞"按钮的Facebook用户列表?
How can I retrieve the list of Facebook users that have clicked the like button on an external site?
说我有一个喜欢的按钮:
Say I have a like button:
<fb:like href="http://example.com/xyz"></fb:like>
我想要一个喜欢它的人的FB用户ID列表.
I'd like a list of FB user IDs of people who have liked it.
我尝试过OpenGraph:
I've tried OpenGraph:
https://graph.facebook.com/OBJECTID/likes/
(其中OBJECTID是example.com/xyz之类的ID)
(where OBJECTID is the id of the like example.com/xyz)
和FQL
select user_id from like where object_id in (
select id from object_url where url = 'http://example.com/xyz'))
但都返回空结果.
从其他通话中我可以看到喜欢被算作是正确的,但我无法获得实际的用户.
I can see from other calls that the likes are counted alright, but I can't get the actual users.
任何人都知道什么权限等.我需要检索这些权限吗?
Anyone know what permissions etc. I'd need to retrieve these?
另请参见此问题获取示例代码.
Also see this question for sample code.
推荐答案
简单的答案是"无法获得喜欢页面的单个用户ID ".
https://graph.facebook.com/cocacola/likes?access_token='xxxxxxxxxxxxxxxxxxxxxxx'
肯定会从用户/页面返回有关喜欢的数据,但不会返回喜欢特定对象(在这种情况下为可口可乐)的用户列表.但是请确保您发送具有适当权限的适当access_token.
will surely return the data about the likes from the user/page but not the list of users who liked the specific object(in this case coca-cola). But make sure you send a proper access_token with proper permissions.
FQL like 用于获取任何对象的喜欢例如视频,注释,链接,照片或相册.要获得喜欢的用户页面计数,请使用 link_stat 或页面.
The FQL like is used to get the likes of any objects like video, note, link, photo, or album. To get liked users count of a page please use either link_stat or page from FQL.
示例查询将类似于
SELECT url, normalized_url, share_count, like_count, comment_count, total_count,
commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url="facebook.com"
SELECT name, fan_count FROM page WHERE page_id = 19292868552
有关此问题的更清晰答案,请阅读
For more clear answers on this, please read the answer by Jonathan Dean in How to list facebook users who like a page or interest
或ifaour答案
or ifaour answer in Querying Users who 'like' my Facebook Page
这篇关于检索喜欢URL/网页的Facebook用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!