通过Facebook投票投票 [英] Voting for items via facebook like?

查看:266
本文介绍了通过Facebook投票投票的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个朋友想要参加每周比赛,用户可以在自己喜欢的图片上投票。他希望用户喜欢一张照片,以便投票。这是一个合理的机制吗?这个工作吗有没有一个合理的方式来取得Facebook的投票号码?



Facebook 表示按钮上的相似数字是以下的总和:

  *此URL的喜欢次数
*此网址的共享数量(包括复制/粘贴回到Facebook的链接)
* Facebook上有关此故事的喜好和评论数量URL
*包含此URL作为附件的收件箱邮件数。

我想确保人们只能投票一次,而不是消息URL很多朋友,以获得投票。



建立这种方式与建立更传统的投票系统有什么不利之处? p>

谢谢!

解决方案

更新: br>
根据新的促销指南,您不能使用Like插件作为投票机制:


您不得使用Facebook的功能或功能,例如Like
按钮,作为促销的投票机制。







实际上使用Facebook作为投票系统不会是一个坏主意,我正在考虑自己实施一个测试投票系统(基于Facebook Like PLugin ..等等)。



该方法将类似于 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:titlecontent =图片标题/> 
< meta property =og:typecontent =website/>
< meta property =og:urlcontent =http://domain.com/path/to/picture/page//>
< meta property =og:imagecontent =http://domain.com/path/to/picture.jpg/>
< meta property =og:site_namecontent =站点名称/>
< meta property =fb:adminscontent =XXXXXXX/>
< meta property =fb:app_idcontent =XXXXXXX/>

所以现在你可以做两件事之一:


  1. 在您的数据库中创建一个记录,您可以根据JS事件

  2. 增加喜好(或用户改变主意并不喜欢时减少)您可以使用FQL( link_stat 表更具体)收集特定URL(对象)的 total_count 并检查最喜欢的

所以根据你的需要,如果你只想从你的页面收集投票(喜欢),使用 FB.events ,否则为FQL。


I have a friend who wants to run a weekly contest where users can vote on their favorite pictures. He wants users to "Like" a photo in order to vote for it. Is this a reasonable mechanism for this action? Will this work? Is there a reasonable way to get the vote numbers out of facebook?

Facebook indicates that the Like number on a button is the sum of:

* The number of likes of this URL
* The number of shares of this URL (this includes copy/pasting a link back to Facebook)
* The number of likes and comments on stories on Facebook about this URL
* The number of inbox messages containing this URL as an attachment.

I'd want to make sure that people would only be able to vote once, and not message the URL to a lot of friends in order to gain votes.

What are the downsides and/or implications of building it this way versus building a more traditional polling system?

Thanks!

解决方案

UPDATE:
Based on the new Promotions Guidelines, you cannot use the Like plugin as a voting mechanism:

You must not use Facebook features or functionality, such as the Like button, as a voting mechanism for a promotion.


Actually using Facebook as a Voting-System won't be a bad idea at all, I'm thinking of implementing a test voting-system myself (based on Facebook Like PLugin..etc).

The approach would be similar to the answer here.
You capture the "likes" and "dislikes":

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'}
    });
});

You set the correct Open Graph Meta Tags:

<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" />

So now you can do one of two things:

  1. Have a record in YOUR DB that you increment the likes (or decrement when a user change his mind and dislike) based on the JS events
  2. You may use FQL (link_stat table to be more specific) to collect the total_count for a certain URL (object) and check for the most liked.

So depending on your needs if you only want to collect votes (likes) from within your page use the FB.events above or the FQL otherwise.

这篇关于通过Facebook投票投票的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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