检索喜欢某个 URL/网页的 Facebook 用户

发布于 2024-10-15 13:21:42 字数 710 浏览 4 评论 0原文

如何检索在外部网站上单击“赞”按钮的 Facebook 用户列表?

假设我有一个喜欢按钮:

<fb:like href="http://example.com/xyz"></fb:like>

我想要一个喜欢它的人的 FB 用户 ID 列表。

我尝试过 OpenGraph:(

https://graph.facebook.com/OBJECTID/likes/

其中 OBJECTID 是 example.com/xyz 之类的 id)

和 FQL

select user_id from like where object_id in (
    select id from object_url where url = 'http://example.com/xyz'))

,但都返回空结果。

我可以从其他电话中看到点赞计数正常,但我无法获取实际用户。

有人知道我需要什么权限等来检索这些吗?


另请参阅此问题示例代码。

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>

I'd like a list of FB user IDs of people who have liked it.

I've tried OpenGraph:

https://graph.facebook.com/OBJECTID/likes/

(where OBJECTID is the id of the like example.com/xyz)

and FQL

select user_id from like where object_id in (
    select id from object_url where url = 'http://example.com/xyz'))

but both return empty results.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

驱逐舰岛风号 2024-10-22 13:21:42

简单的答案是“不可能获取喜欢某个页面的个人用户 ID”。

https://graph.facebook.com/cocacola/likes?access_token='xxxxxxxxxxxxxxxxxxxxxxx'

肯定会从用户/页面返回有关喜欢的数据,但不会返回喜欢特定对象(在本例中为可口可乐)的用户列表。但请确保您发送具有适当权限的正确 access_token。

FQL like 用于获取任何对象(例如视频)的点赞,注释、链接、照片或相册。要获取页面的喜欢用户数,请使用 link_stat页面。

示例查询将类似于有关

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

此问题的更清晰答案,请阅读 Jonathan Dean 在 如何列出喜欢某个页面或感兴趣的 Facebook 用户

或 ifaour 答案 查询“喜欢”我的 Facebook 页面的用户

The simple answer is 'Its not possible to get individual user ids who liked a page'.

https://graph.facebook.com/cocacola/likes?access_token='xxxxxxxxxxxxxxxxxxxxxxx'

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.

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.

the sample query will be like

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

or ifaour answer in Querying Users who 'like' my Facebook Page

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文