Facebook like button in web pages will bring lots of traffic to our website.But to make it more viral you could always give freebies and make people to like your fan page.(ie) You give freebies only for the user’s who have liked your fanpage.There is a premium plugin for doing this in wordpress(LINK).This tutorial will tell you how to make this script for free using facebook api.It is very simple,just we need to check weather a user has liked our facebook page or not using facebook api.
Technologies Used
- Facebook API
- Jquery(Ajax call)
FB.Event.subscribe('edge.create',function(response) {
download();
});
FB.api("me/likes/270801249647033", function(response) {
if ( response.data.length == 1 ) { //there should only be a single value inside "data"
download();
} else {
//do nothing
}});
$.post("download.php",{url:"http://www.facebook.com/pages/Webtutsinfo/270801249647033"}, function(data) {
location.href=data;
$("#like").fadeOut();
});


