Get facebook posts and total count of likes for each post
Asked Answered
V

2

6

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.

Vehicular answered 2/3, 2015 at 9:6 Comment(0)
M
3

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!!!!

Morven answered 2/3, 2015 at 9:26 Comment(2)
That is an awesome answer, it does explain alot and helps! Thank you.Vehicular
@Morven ..134134444463871/?fields=likes.summary(1)...this gives me all the likes of a user, but i need total-like-count of a user..i don't know what i am missingUnbated
S
0

You can try this

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

?fields=likes.limit(0).summary(true),comments.limit(0).summary(true)
Scottie answered 24/8, 2017 at 13:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.