跟踪 Facebook 点赞点击次数

发布于 2024-11-05 20:28:29 字数 470 浏览 0 评论 0 原文

我正在尝试在我的网站中构建一个功能,我将奖励“喜欢”网站上的页面/帖子/项目的用户。我知道使用 FQL 我可以查询 like 表并找出谁喜欢它。另外,我可能需要订阅 edge.create event 才能知道当有人“喜欢”它时。

然而我的问题是这样的。我的网站上没有 Facebook 连接,因此我不知道网站用户的 Facebook UID。现在,由于没有任何共同点,我将如何将点击“赞”的 Facebook 用户与我的本地网站用户进行比较?或者我需要强制通过 FB connect 登录吗?欢迎任何解决方案(干净的或肮脏的)。

I am trying to build a function in my site where I'll reward the users who 'Like' a page/post/item on site. I know using FQL I can query the like table and find out who liked it. Also I probably need to subscribe to edge.create event to know when someone 'Like' it.

However my question is this. I don't have Facebook connect on my site so I don't know the facebook UID of my site users. Now how I'll compare the Facebook user who click on like with my local site user since there is nothing in common? Or do I need to make login via FB connect mandatory? Any solutions (neat or dirty) are welcome.

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

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

发布评论

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

评论(2

往事风中埋 2024-11-12 20:28:29

我想您链接到 Like FQL 表这一事实意味着你对整件事有点困惑。

这里有几点:

  1. 在用户授权您的应用程序之前,Facebook 将不会共享用户 ID
  2. 您应该查看的表是 link_stat;正如您所看到的,其中没有“uid”,
  3. 因为您没有实现 Facebook Login,但您仍然拥有自己的系统,我想您可以通过 edge 捕获类似内容。创建,通过 ajax 运行奖励例程,并且由于您已经登录了本地站点用户,因此您可以对其进行检查。

I guess that the fact that you linked to the Like FQL table this means that you are a bit confused about the whole thing.

Here's a couple of points:

  1. Facebook will not share the user id until the user authorize your App
  2. The table you should be looking to is link_stat; and as you can see there's no "uid" in it
  3. Since you don't have Facebook Login implemented but you still have your own system, I suppose you can capture the like through the edge.create, run the reward routine through ajax and since you already have the local site user logged in you can check against that.
别念他 2024-11-12 20:28:29

您应该识别网站上的用户并使用回调解决方案保存他的喜好:

FB.Event.subscribe('edge.create', function(href, widget) {
    // callback will be fired when some one clicked your like button
    // your code to save here ...
    alert('You liked ' + href, widget);
});

在此处查找有关事件订阅的更多信息:http://developers.facebook.com/docs/reference/api/event/

在这里找到大量示例:http://fbrell.com/xfbml/fb:like

You should identify the user on your site and save his liking by using a callback solution:

FB.Event.subscribe('edge.create', function(href, widget) {
    // callback will be fired when some one clicked your like button
    // your code to save here ...
    alert('You liked ' + href, widget);
});

Find more info aboeut event subscriptions here: http://developers.facebook.com/docs/reference/api/event/

Find lots of samples here: http://fbrell.com/xfbml/fb:like

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