我被要求网站的用户在 Facebook 上分享内容并获得积分作为返回。目前这在技术上似乎是不可能的,因为内容是通过 addthis 网站共享的。有没有一种方法可以检测某些内容是否已在墙上、 friend 的墙上共享,或者至少是否有人点击过?
最佳答案
使用 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 请求让服务器知道发生了什么,而不是提醒
帖子已发布。
关于php - 验证内容是否已在 Facebook 上共享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6505750/