Verifying if content has been shared on Facebook
I was given a requirement where the user of a site shares content on Facebook and gets points in return. This doesn't seem technically possible at the moment as content is shared through the addthis web site. Is there a way I could detect if some content has been shared on a wall, on the wall of a friend or at l开发者_如何学运维east whether someone has clicked on it?
Using the JavaScript SDK, this is possible (example from 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.');
}
}
);
From there, instead of alert
ing that the post was published or not, you could set a form variable or make an AJAX request to let the server know what happened.
Have you looked at the Facebook graph API? You can make your own buttons for the user to share with, and say "if you share using this button" to give them points.
http://developers.facebook.com/docs/
You can also look at FBML.
精彩评论