Can any one help how to get facebook recommended count in php.
I search for facebook api but i dint found any.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A Recommendation is a Like. You can see it in the reference of the like button :
To get the counts for a URL (here
http://stackoverflow.com), you can make an FQL call :Call directly
And
$jsonwill contain :You have here :
share_count: the counts of shares for the URLlike_count: the count of likes (= recommendations)comment_count: the count of comments in Facebook below shares of that linktotal_count: the sum of theses 3 countsYou can read json in PHP with
json_decode:Use the Facebook PHP SDK
EDIT : As Rufinus pointed out int the comments of his answer, for stability reasons, if you are on a long term project and not just a quick experiment you should use the Facebook PHP SDK (see on github) to make FQL queries : Facebook is more and more closing public access (read without access token) to its API (see this blog post on Facebook developers blog). Even like here when theses queries are not related to any user : the SDK is using the app access token to make the query.
The
$resultarray contains what you need (like_countfield) and even more :