Andrew
Andrew

Reputation: 23

How to require a Facebook like to change content on an external web site? (I'm not referring to a Facebook page)

I am writing because I've spent several days searching for the solution as to how CampusCred.com, for example, allows for an instant discount on an item if you "like" the page on Facebook. Here's an example:

http://www.campuscred.com/usc

Look for this: the voucher starts at $6. Then, hit "like." Then, note that the $6 just went down to $5.50. And if I unlike the link, it goes back to $6. Pretty neat!

I am trying to apply this to a script for an external web site where you have to hit "like" in order to receive a download link. Please advise, any help would be great!

Thanks Andrew

Upvotes: 2

Views: 754

Answers (1)

smartcaveman
smartcaveman

Reputation: 42266

You need to subscribe a callback function to the Like button.

Here is the API documentation: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

The relevant events are edge.create (fired when the user likes something) and edge.remove (fired when the user unlikes something)

Upvotes: 2

Related Questions