How to get the total number of likes & comments about particular post? - facebook

I want to get the total number of like & comments for a particular post on my website, for eg. if my website has 100 pages, I integrate facebook like button on every page, how can i get the number of likes related to that page or post? I have take a look a GRAPH API, but i did n't find any thing relating to my issue.

Check this
Facebook documentation
simply use this javascript code. (change the url)
FB.api({
method: 'fql.query',
query: 'SELECT url, normalized_url, share_count, like_count, comment_count, total_count, commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url="http://www.facebook.com"'
}, function(response){});

Related

How to get most commented pages on your website?

I am having a problem getting the most commented pages on my site. I wanted to return list of pages sorted by their comment count.
I have tried this one. But this is not efficient for me I have a lot of pages.
SELECT url, normalized_url, share_count, like_count, comment_count, total_count,
commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url IN ( "url",
"url2") LIMIT 10
Are there other ways to get this?
There are no ways via the API to query the most commented pages on your website. If you have Insights integrated into your website you can make a close approximation.

Facebook link_stat Incorrect Unique URL Stat

I'm using this FQL to get the number of likes of every article in my app.
SELECT share_count, like_count, comment_count, total_count FROM link_stat WHERE url="http://www.example.com/some/dir/slug"
However, I've been noticing that the number and the like button doesn't seem to take the slug into factor. So when I'm debugging it in Graph API Explorer, the stat for http://www.example.com/some/dir/slug and http://www.example.com/some/dir is the same.
Is this FB bug?
Thanks
The og:url meta tag has to contain the individual URL for each article - otherwise, if it is the same URL value for all articles, Facebook will count all likes for that very URL.

get facebook like counts for a given url

When I use https://developers.facebook.com/docs/reference/fql/link_stat
i got this informations like_count, commentsbox_count , share_count , comments_fbid
like_count is the number of times Facebook users have "Liked" the page, or liked any comments or re-shares of this page. can I only get the count of users who clicked on my like button page ?
You are already getting the like count, just make your fql as below
SELECT like_count FROM link_stat WHERE url=your_url

Facebook sharing data for url

I am working on a project to get shares for different articles of the client. I searched whole internet but did not find any info so as a last resort putting the question here:
Is there a way to check how many shares an article has on facebook by giving just the url of the article? I have seen code on facebook where you can get number of likes for your own article you paste but is there a way to tell lets say if some techcruch article has how many facebook shares?
Here is the reference:
https://developers.facebook.com/docs/reference/fql/link_stat/
Sample query to get number of shares for a Techcrunch article:
SELECT url, normalized_url, share_count, like_count, comment_count,
total_count, commentsbox_count, comments_fbid, click_count FROM
link_stat WHERE
url="http://techcrunch.com/2012/07/25/zipongo-seed-round/"
You can play around with different queries here:
https://developers.facebook.com/tools/explorer
(choose FQL from the menu)

fql like count limit

Is there same restriction to use FQL to get likes count for some urls?
SELECT url, normalized_url, share_count, like_count, comment_count, total_count, commentsbox_count, comments_fbid, click_count FROM link_stat WHERE url in ("site.com/page1.html","site.com/page2.html")
I want to get an likes count for thousends of urls in my domain. I will run it from cron script in every night (server is in Europe), but I'm afraid that facebook will ban my ip/server after such us mass request.
The HTTP Get command has a max limit length that might get in your way before Facebook might.
http://social.technet.microsoft.com/Forums/en-US/fastsharepoint/thread/b193fc10-3c39-43d3-9e4a-378ff90125f2