I want to store all details about particular post which includes likes, comments and shares. I am able the fetch likes and comments with following syntax:

graph.get_object('/'+post_id+'/likes?limit=10000&format=json')
graph.get_object('/'+post_id+'/comments?limit=10000&format=json')

In similar fashion i tried to fetch share details of that particular post

graph.get_object('/'+post_id+'/share?limit=10000&format=json')

but it returns empty array. But when fire this query:

graph.get_object('/'+post_id)

its returns lots of data and also says that "shares"=>{"count"=>26}

So that particular post has shares but i am not able to fetch share.

有帮助吗?

解决方案 2

Yes i figured out

graph.get_object('/'+post_id+'/sharedposts?limit=10000&format=json')

其他提示

Looking at facebook's documentation I'm not sure you can get anymore than the count.

In case someone else finds this like I did - please note that you will need the "read_stream" permission on the Facebook app in order to make this work.

https://developers.facebook.com/docs/graph-api/reference/v2.2/object/sharedposts

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top