如何确定 Facebook 用户是否喜欢某个 URL?

发布于 2024-10-18 20:19:06 字数 1257 浏览 3 评论 0原文

我们有一个网络应用程序,需要跟踪用户对 URL(不是 Facebook 页面,外部页面)的“喜欢”,因为他们会因此获得积分。

为此,我们使用 JQuery 和订阅 (edge.create) 事件,它运行良好。 http://developers.facebook.com/docs/reference/javascript/ FB.Event.subscribe/

不幸的是,我们似乎无法找到一种方法来处理用户通过我们的网站“喜欢”某个 URL,获得积分,然后转到他们的 Facebook 墙并“不喜欢”的情况它本质上是在欺骗系统。

我尝试了这两个 FQL 查询。第一个应该返回 URL 的对象 ID,第二个应该返回“喜欢”该 URL 的 user_ids 列表。但它们似乎不一致,并且并不总是为我测试的每个案例返回数据。

https://api.facebook.com/method/fql.query?query=select%20id%20from %20object_url%20where%20url=%22http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/%22

https://api.facebook. com/method/fql.query?query=SELECT%20user_id%20FROM%20like%20WHERE%20object_id=%22393958018726%22

我们不想让用户通过 Facebook 授权我们的应用程序,并给我们访问他们的数据的权限,以便使这项工作正常进行。

有什么想法吗?提前致谢!

We have a web app where we need to track users "Likes" of URLs (not Facebook pages, external ones), because they earn credits for doing so.

To do this we're using JQuery and the subscribe (edge.create) event and it's working great.
http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

Unfortunately we can't seem to figure out a way handle the case where a user "Likes" a URL through our site, earns a credit, then goes to their Facebook Wall and "Unlikes" it, essentially cheating the system.

I played around with these two FQL queries. The 1st is supposed to return an object ID of a URL, and the 2nd should return the list of user_ids who "Like" the URL. But they seem inconsistent and don't always return data for every case I tested.

https://api.facebook.com/method/fql.query?query=select%20id%20from%20object_url%20where%20url=%22http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/%22

https://api.facebook.com/method/fql.query?query=SELECT%20user_id%20FROM%20like%20WHERE%20object_id=%22393958018726%22

We'd rather not have to get the users to authorize our app with Facebook, and give us permission to access their data, in order to make this work either.

Any ideas? Thanks in advance!

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

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

发布评论

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

评论(2

久随 2024-10-25 20:19:06

在 FQL 的见解表中,您有指标 "domain_fan_removes" 、 "page_fan_removes" 、 "application_like_removes" 和 "domain_like_removes"
http://developers.facebook.com/docs/reference/fql/insights/
这可能会有所帮助。

https://api.facebook.com/method/fql.query?query=SELECT%20metric,value%20FROM%20insights%20WHERE%20object_id=118584441503782%20AND%20metric='page_fan_removes'%20AND%20end_time= end_time_date('2011-02-01')%20AND%20period=period('lifetime')&access_token=xxxxx

In in insights table of FQL you have metrics "domain_fan_removes" , "page_fan_removes" , "application_like_removes" and "domain_like_removes"
http://developers.facebook.com/docs/reference/fql/insights/
This might help.

https://api.facebook.com/method/fql.query?query=SELECT%20metric,value%20FROM%20insights%20WHERE%20object_id=118584441503782%20AND%20metric='page_fan_removes'%20AND%20end_time=end_time_date('2011-02-01')%20AND%20period=period('lifetime')&access_token=xxxxx

小苏打饼 2024-10-25 20:19:06

通过 JS Api,您可以使用 FB.Event.subscribe

FB.Event.subscribe('edge.create',
    function(response) {
        alert('You liked the URL: ' + response);
    }
);

或者如果用户不喜欢某个网址,则可以使用 edge.remove

FB.Event.subscribe('edge.remove',
    function(response) {
        alert('You unliked the URL: ' + response);
    }
);

https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

With the JS Api you can use the FB.Event.subscribe,

FB.Event.subscribe('edge.create',
    function(response) {
        alert('You liked the URL: ' + response);
    }
);

or you can use edge.remove if user unlike a url:

FB.Event.subscribe('edge.remove',
    function(response) {
        alert('You unliked the URL: ' + response);
    }
);

https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

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