本文介绍了通过 Open Graph 检索喜欢 URL/网页的 Facebook 用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检索在外部网站上点击了赞"按钮的 Facebook 用户列表?

Is there a way to retrieve the list of Facebook users that have clicked the like button on an external website?

  • 例如有一个域 example.com 已通过 Facebook Insights 确认属于 fbUser1(使用 OG 元标记).
  • example.com 上的某个页面有多个类似 XFBL 的按钮,每个按钮都指向 example.com 上的另一个特定 URL,例如example.com/xyzexample.com/abc
  • E.g. there is a domain example.com which has been confirmed via Facebook Insights to belong to fbUser1 (using OG meta tags).
  • Somewhere on example.com there is a page with multiple XFBL like buttons, each one pointing to a further specific URL on example.com, e.g. example.com/xyz, example.com/abc etc.

我想得到的是喜欢 example.com/xyz 的用户和喜欢 example.com/abc 的用户列表.

What I'd like to get is the list of users that liked example.com/xyz and of those who liked example.com/abc.

我的直观方法是查看 graph.facebook.com/123456789/likes(其中数字是从 FB 洞察中获取的域的 ID),但这总是返回一个空数据集:

My intuitive approach would be to look at graph.facebook.com/123456789/likes (where the number is the ID of the domain taken from FB insights), but this always returns an empty dataset:

{
   "data": [

   ]
}

我还尝试从 https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=APPID&client_secret=APPSECRET(其中APPIDAPPSECRET取自使用 OG 元标记标记为拥有域的 FB 应用程序),但这没有区别.

I've also tried getting an OAuth access token from https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=APPID&client_secret=APPSECRET (where APPID and APPSECRET are taken from a FB application that is marked as owning the domain using OG meta tags), but that makes no difference.

我也对非 OpenGraph(即 JS SDK、FQL 等)解决方案感兴趣.

I'd also be interested in a non-OpenGraph (i.e. JS SDK, FQL etc.) solution.

编辑:使用以下代码(根据 WideBlade 的 )仍然给我一个空的喜欢列表(第二个查询永远不会返回):

EDIT: Using the following code (according to WideBlade's answer below) still gives me an empty list of likes (the second query never returns):

var objectsQuery = "select id from object_url where url in ('http://example.com/xyz', 'http://example.com/abc', 'http://example.com/123')";
var likesQuery = "select object_id from like where object_id = {0}";

FB.Data.query(objectsQuery).wait(function (objectRows) {
    console.log(objectRows);

    FB.Array.forEach(objectRows, function (objectRow) {
        FB.Data.query(likesQuery, objectRow.object_id).wait(function (likeRows) {
            console.log(likeRows);
        })
    });
});

推荐答案

这是不可能的.Facebook 不允许您查询喜欢某个页面的人的特定用户 ID.这是出于隐私考虑.

This cannot be done. Facebook does not allow you to query for specific user ID's of people who have liked a certain page. This is because of privacy concerns.

请参阅此页面上的免责声明 https://developers.facebook.com/docs/reference/fql/like/

See the disclaimer on this page https://developers.facebook.com/docs/reference/fql/like/

这篇关于通过 Open Graph 检索喜欢 URL/网页的 Facebook 用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 06:21