cgval
cgval

Reputation: 1096

FQL - Get all post in the wall of a user

I need to get all me() wall posts. I am using the following FQL:

SELECT post_id, comments, message 
FROM stream
WHERE source_id = me() 
AND created_time > 946684800 AND created_time < now()

but this only returns 7 entries, where as a matter of fact there must be much much more.. (NB 946684800 = Sat, 01 Jan 2000 00:00:00 GMT)

I also tried to use the following query:

SELECT post_id, actor_id, target_id, message, comments 
FROM stream 
WHERE source_id = me() 
AND is_hidden = 0
ORDER BY created_time 
DESC LIMIT 1000000

that although it returns 394 entries, the earliest data is Mon, 30 Apr 2012 12:56:04 GMT, where for it must go back more.

I need to have in possession the whole wall posts a user have submitted.

Any ideas before I get frustrated even more :) ?

Upvotes: 3

Views: 9345

Answers (2)

Saber Kordestanchi
Saber Kordestanchi

Reputation: 338

just notice as facebook announced, as of February 6th, 2013 offset no longer allowed when searching posts. Use 'since' and 'until' to do paging instead.

Upvotes: 1

Anvesh Saxena
Anvesh Saxena

Reputation: 4466

Simple answer to your question is...you can't get all posts on the wall with just one query, you will have to loop and make more requests to get further posts. You can also check this blog post on paging made by Facebook to understand more clearly as to how the result are sent by Facebook. Also remember the maximum results you can have before Facebook trims it for visibility checks is 5000 as mentioned in the post.

Upvotes: 1

Related Questions