I use graph api to get the picture's comments, but I want to first sort the results by creating time and then return to the latest data. Similar to the sql statement 'order by create_time desc', I do not know if have such a parameter.

Currently used to offset and limit access to the latest data, but also know the total number of comments,

pagesize = 25;
offset = comments.count - pagesize;
limit = 25;

url = "https://graph.facebook.com/" + object_id + "/comments?access_token=" + access_token + "&limit=" + limit + "&offset=" + limit;

next page:

offset -= 25

but comments.ount of numerical sometimes is not accurate

and the result of the request URL to return to sometimes don't match

Whether to have very good solution

Or I used the wrong way (‘limit’ and ‘offset’ Parameter)!!!


Thank you for your answer.

"Graphics API" the existence of the cache?

i post a message and 46 comments.requests url, set the parameters:

offset=0&limit=1

Then it should return to the last comment (latest one), the actual return to the middle of a comment, and I tested a few times, set the offset and limit. According to the returned results, the middle one is the latest comment

If I set the limit value is greater than the 'comment.count', the returned data is all, the official website and facebook consistent

Because the cache reason?

Thanks again~

Edit
Report