views:

60

answers:

2

How to get the number of Likes in facebook like button?

Here is my scenario, I have five like buttons, I want to sort the buttons based on the number of likes. Is it possible?

A: 

There is a button_count settings which once specified, will display the counts to the right of the button.

More Info:

Sarfraz
Ok.. I already set that, what i would like to do is to get that number. Here is my scenario, I have five like buttons, I want to sort the buttons based on the number of likes. Is it possible?
scoohh
@scoohh: Well, i can't figure out an easy way for that and it isn't going to be that easy what i can suspect.
Sarfraz
ok, thanks anyway..
scoohh
+1  A: 

You can get number of likes for any URL by running FQL on link_stat table:

SELECT like_count, url FROM link_stat WHERE url IN("FIRST_SHARE_URL","SECOND_SHARE_URL") ORDER BY like_count

then display buttons in corresponding order.

serg