Search code examples
ruby-on-railsfacebook-graph-apikoala

How to fetch facebook post share details with the help of koala gem


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.


Solution

  • Yes i figured out

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