UPDATE:
基于新Promotions Guidelines,你不能使用像插件作为一个投票机制:
不得使用Facebook的特性或功能,比如像 按钮,作为促销的投票机制。
实际使用Facebook的这一表决,系统将不会是一个坏主意,我想执行的测试投票系统自己(基于在Facebook上一样PLugin..etc)的。
这种方法将类似于这里answer。
您捕捉到 “喜欢” 和 “不喜欢”:
FB.Event.subscribe('edge.create', function(response) {
$.ajax({
type: 'POST',
url:'/voting.php',
data: {vote: 'up'}
});
});
FB.Event.subscribe('edge.remove', function(response) {
$.ajax({
type: 'POST',
url:'/voting.php',
data: {vote: 'down'}
});
});
设置了正确的Open Graph的Meta标签:
<meta property="og:title" content="Picture Title" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://domain.com/path/to/picture/page/" />
<meta property="og:image" content="http://domain.com/path/to/picture.jpg" />
<meta property="og:site_name" content="Site Name" />
<meta property="fb:admins" content="XXXXXXX" />
<meta property="fb:app_id" content="XXXXXXX" />
所以,现在你可以做两件事情之一:
- 在你的数据库中有一个记录,你增加喜欢(或减少当用户cha NGE他的基础上,JS事件的头脑和不喜欢)
- 您可能使用FQL(
link_stat
表更具体)收集total_count
一定URL(对象),并检查为最喜欢的。
因此,根据您的需要,如果您只想从页面内收集选票(喜欢),请使用上面的FB.events
或其他方式。
对于已接受的答案已晚,抱歉。感谢您提供有关新促销指南的更新。 – John 2011-11-10 18:32:27
欢迎您! – ifaour 2011-11-11 08:16:19
更新:促销指南不再包含上述条款。 – Tim 2014-06-04 07:08:08