0

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?

pixelearth
  • 13,674
  • 10
  • 62
  • 110
  • Here is a serverside approach, but in PHP. http://stackoverflow.com/questions/5093398/check-if-user-liked-page You should easily do this in rails too. There is no need to store the user info in your DB using this approach. – Eswar Rajesh Pinapala Jun 21 '12 at 22:10

2 Answers2

1

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.

Community
  • 1
  • 1
Jesse Wolgamott
  • 40,197
  • 4
  • 83
  • 109
  • Won't this only capture those who've liked me via that specific button? What if they visit the fb page directly and like it there? – pixelearth Jun 22 '12 at 15:39
1

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:

Alfredo Solano
  • 784
  • 6
  • 5