0

I know how to get the most recent comments for a Facebook object via FQL:

SELECT id, fromid, text, time, likes, user_likes FROM comment
WHERE object_id = [FB_OBJ_ID] ORDER BY time DESC LIMIT 25

How do I make subsequent requests to get the previous (older) batch of entries when the user clicks a button, so that every time the user asks for it I fetch the next batch of older posts. Ideally I can use the same query on every call with only an offset changing.

I'm familiar with offset and limit for the Graph API but can figure out how to use it in FQL to iterate backwards in time.

4

1 回答 1

3

添加OFFSET [(LIMIT_NO * n)+1]到查询的末尾,您在哪里LIMIT_NO使用LIMITn数字是您希望返回的页数。

因此,要获得接下来的 25 个结果,您的查询变为

SELECT id, fromid, text, time, likes, user_likes FROM comment
WHERE object_id = [FB_OBJ_ID] ORDER BY time DESC LIMIT 25 OFFSET 26
于 2012-10-27T13:42:29.813 回答