验证内容是否已在Facebook上共享

时间:2011-06-28 11:32:38

标签: php mysql facebook

我被要求网站的用户在Facebook上共享内容并获得积分作为回报。目前在技术上似乎不太可能,因为内容是通过addthis网站共享的。有没有办法可以检测到某些内容是在墙上,朋友的墙上共享,还是至少有人点击过它?

2 个答案:

答案 0 :(得分:2)

你看过Facebook图形API了吗?您可以创建自己的按钮供用户共享,并说“如果您使用此按钮共享”,则为他们提供分数。

http://developers.facebook.com/docs/

您还可以查看FBML。

答案 1 :(得分:2)

使用JavaScript SDK,这是可能的(例如来自here):

FB.ui(
   {
     method: 'feed',
     name: 'Facebook Dialogs',
     link: 'http://developers.facebook.com/docs/reference/dialogs/',
     picture: 'http://fbrell.com/f8.jpg',
     caption: 'Reference Documentation',
     description: 'Dialogs provide a simple, consistent interface for applications to interface with users.',
     message: 'Facebook Dialogs are easy!'
   },
   function(response) {
     if (response && response.post_id) {
       alert('Post was published.');
     } else {
       alert('Post was not published.');
     }
   }
 );

从那里开始,您可以设置表单变量或发出AJAX请求,让服务器知道发生了什么,而不是alert发布了帖子。