0

I am curious if you can store facebook likes in your own MySql database.

I did a search and I didn't find anything concludent. What I want to store for example are the likes of a pic/pics from my website. If is possible I would appreciate if you tell me how :) Thnx in advance. I found some code but I dont know how to modify it to make it working :)

  FB.Event.subscribe('edge.create',
        function(href, widget) {
            alert('You liked the URL: ' + href);
        }
    );
tlenss
  • 2,609
  • 2
  • 22
  • 26
user3058067
  • 307
  • 6
  • 18
  • actualy that is not an answer of my question, i use fb like button on my website for each pic to counter likes, and i want to store those likes on my database, they are not pics from facebook... – user3058067 Jan 10 '14 at 15:33

1 Answers1

0

Every LINK has an Facebook ID that you can get with:

https://graph.facebook.com/fql?q=SELECT%20id%20FROM%20object_url%20WHERE%20url%20%3D%20%27http%3A%2F%2Fgetqr.eu%2F%27
/* Not encoded: https://graph.facebook.com/fql?q=SELECT id FROM object_url WHERE url = 'http://getqr.eu/' */
/* this is SELECT id FROM object_url WHERE url = 'http://getqr.eu/' */
/* getqr is my website and is for reference only */

Facebook replies with:

{
   "data": [
      {
         "id": "10150312949782288"
      }
   ]
}

Then you can query for likes every time you want:

https://graph.facebook.com/10150312949782288/

Of course you will need authenticate first.

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107