pixelearth
pixelearth

Reputation: 14630

How do I make content available on my site in exchange for a Facebook "like"

I have a site with a lot of for-purchase content. I also have some sampler content for "free".

A LOT of people download this sample content, and I would like to now only allow access to the free content if the user is willing to "like us" on facebook.

How can I implement this? I'm a rails developer, but it may not matter what the app is.

How can I ask a user to like us, and then verify that they have?

Upvotes: 0

Views: 181

Answers (2)

Alfredo Solano
Alfredo Solano

Reputation: 824

The best option is using the Javascript SDK from facebook. You can read all likes from an user or ask for specific page:

FB.api("/me/likes/" + PAGE_ID, function(response) {
    // Do some staff here with page data
 })

FB.api("/me/likes/", function(response) {
    // Do some staff here with all pages data
 })

You can use the Graph API explorer in order to test this:

Upvotes: 1

Jesse Wolgamott
Jesse Wolgamott

Reputation: 40277

This answer is probably where you want to start: How can I make sure that someone has successfully "liked" my site when they press the "like" button on my site?

FB.Event.subscribe('edge.create', function(response) {
  // fire an ajax call to store that the user has liked you
});

So then you'd handle in javascript that they have liked you, and you can unlock content to your new friends.

Upvotes: 1

Related Questions