通过Open Graph获取像URL /网页一样的Facebook用户 [英] Retrieve Facebook users that like a URL / web page via Open Graph

查看:78
本文介绍了通过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?


  • 例如。有一个已经通过 Facebook Insights 确认的域 example.com 属于 fbUser1 使用OG元标记

  • 在example.com上的某个地方,有一个带有多个XFBL的按钮的页面,每个页面都指向example.com上的另一个特定网址/ em>,例如 example.com/xyz example.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 (其中 APPID APPSECRET 取自FB应用程序标记为拥有使用OG元标记的域的域名),但这没有任何区别。

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 answer 仍然给我一个空的列表(第二个查询从不返回):

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用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆