0
votes

I'm trying to build an app using facebook's JS SDK and Graph API, and got a little confused in process. The idea is simply to take every post user have created on his timeline. As listed in docs to do this you need to call feed connection, to get an array of post object representing posts users make to their wall.

The thing is when using standard request to get last 30 post (with read_stream permission)

FB.api('/me/feed?limit=30&format=json', function(response) {
      //operations on response.data
}

in response graph api returns not only the timeline posts user made, but also some of comments on other peoples posts. So it seems feed doesn't return just "The user's wall." posts, as written in doc, but all things user posted. Request to */user_id/posts* is giving pretty much the same result.

The confusing part is that user text posts to his/hers timeline and comments on other people's posts have the same type of "status". The difference between them is that timeline post has it's content in "message" field and comment stores text in "story".

So my question: Is there a way to sort only timeline posts made by user, within a request itself?

1

1 Answers

1
votes

So after facebook updated it's docs it is now clear that you need to call /{user-id}/posts to show only the posts that were published by user.

Call to /{user-id}/feed on the other hand returns the feed of posts, including status updates and links published by user, or by others on user's profile.

More about so called "derivative edges" here: https://developers.facebook.com/docs/graph-api/reference/user/#edges