1

For example, I have http://www.example.com/abc.html.

If I like this page, how can I detect me that have already like this page using facebook php api.

Give me help, please

浩然莫
  • 21
  • 2
  • 1
    Wouldn't that be an invasion of your users' privacy? And hen you can discriminate what you show them based on that... seems shady to me. – Etienne Perot May 10 '12 at 02:31
  • from what I've seen of the Facebook API, it only works on Facebook URLs. – jcomeau_ictx May 10 '12 at 02:33
  • Possible duplicate: http://stackoverflow.com/questions/5832018/detect-like-with-facebook-javascript-api-iframe – Ja͢ck May 10 '12 at 02:33
  • 1
    Possible duplicate: http://stackoverflow.com/questions/5093398/check-if-user-liked-page – Andy May 10 '12 at 02:34
  • @EtiennePerot how's that invasion of privacy? Is it also invasion of privacy when your wine seller decides to cut you a deal for "liking" his shop? – Ja͢ck May 10 '12 at 02:37
  • @Jack No, but I do think that it is an invasion of privacy for the wine seller to be able to know whether you like his shop or not without asking you. – Etienne Perot May 10 '12 at 06:55
  • @EtiennePerot but when I like a page, I'm already telling you that I like the page (i.e. `FB.Event.subscribe('edge.create', ... `) – Ja͢ck May 10 '12 at 07:02
  • @Jack I see. I suppose the analogy doesn't really hold when using the facebook meaning of the word "like". As you can tell, I am not really familiar with these things, sorry – Etienne Perot May 10 '12 at 07:20

2 Answers2

0

You can collect who likes your page using the newest facebook sdk. What you would do is a sort of work around using their app interface, which is just a LIKE script for your site, and then call https://graph.facebook.com//subscriptions to record the information via mysql or whatever db you are using. I use this method when collecting facebook invites for random contests I hold.

  • Thanks all guy reply. I am green of facebook api Someone can give me some code for explanation. many thanks – 浩然莫 May 10 '12 at 09:45
0

You can use cookies that must be set in the Like button callback or can use Facebook Connect to check whether a user likes your page but this way requires extra permissions and a created facebook app.

Also there is a ready solution for jquery: http://codecanyon.net/item/like-2-unlock-for-jquery/2822035

Jean Louis
  • 1,485
  • 8
  • 18
  • 33