Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get facebook posts and total count of likes for each post

I am trying to get a Facebook page posts with count of comments and likes for each post.

For likes there is a parameters I can pass which is summary = true and total_count . I tried this

page_id?fields=posts.limit(1).summary(1)

but nothing comes back.

I can not write FQL as it will be deprecated soon. I am writing php API.

like image 468
George Mylonas Avatar asked Mar 02 '15 09:03

George Mylonas


People also ask

How do I count my total likes on Facebook?

Just go to your page and click on the custom tab that shows the number of likes you have. Here, you'll find the total number of likes and people talking about a page, basic demographics, a graph of the page's popularity over the last month, and your friends who like the page.

How do I pull Facebook Analytics?

Tap in the top right of Facebook. Tap Pages, then go to your Page. Tap More at the top of your Page, then tap Insights. To see more insights or to export insights, log into Facebook from a computer.

Is there a way to count the number of times each individual Facebook friend has liked your Facebook posts?

No, that is not really possible. Each of your friends would have to sign in to your app and grant it permission to read their likes, and you would need to have valid individual user tokens available for all of them each time you want to request this data, because “A User or Page can only query their own likes.

How can I see photos someone likes on Facebook 2022?

Click the magnifying glass icon at the upper corner of your screen and enter the name of the Facebook user in the search bar. Choose the “About info” to be directed to the pages that they liked. In the likes section, you will see the pictures, videos and other content that the user liked. Click the “View all”.


1 Answers

You can get total count by passing arguments like

?fields=likes.summary(1),comments.summary(1),

$fbtimeposts = (new FacebookRequest($session, 'GET', "/me/feed?fields=likes.summary(1),comments.summary(1),story,link,comments,likes,source,picture,type,status_type,application,message,message_tags,name,caption,actions,from,feed_targeting,full_picture,description,updated_time,created_time,id,object_id,parent_id,place,story_tags,targeting,with_tags&limit=10&date_format=U&limit=10&date_format=U"))->execute()->getGraphObject()->asArray();  

I hope above example helps you in someway!!!!

like image 159
jones Avatar answered Nov 15 '22 08:11

jones