您可以在页面中使用 facebook javascript SDK 来检测用户在浏览粉丝页面时是否喜欢该页面。然后您可以使用 AJAX 存储到文件/数据库中
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script>
window.fbAsyncInit = function () {
FB.init({
appId: 'INSERT APP ID',
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
oauth: true // enable OAuth 2.0
});
//Additional
FB.Event.subscribe('edge.create', function (response) {
alert('Put AJAX Code Here');
});
};
// Load the SDK Asynchronously
(function (d) {
var js, id = 'facebook-jssdk',
ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement('script');
js.id = id;
js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
希望这会有所帮助...
http://www.skruffymedia.com/blog/creating-a-facebook-like-gate-competition/