I am somehow confused about how FQL Facebook works. I need to get a "fan of the month" for a specific page. This is the user who made most of the posts and comments.
The facebook FQL documentation says:
Each query of the stream table is limited to the previous 30 days or 50 messages, whichever is greater, however you can use time-specific fields such as created_time along with FQL statements (for example, <or>) to receive a much larger number of messages .
And what am I doing. I get messages in a specific range as follows:
SELECT actor_id,created_time FROM stream WHERE source_id = '.$wallid.' AND (created_time >= '.$date_start.' OR updated_time >= '.$date_start.')'
It seems to work - somehow - but I have problems with comments. I do not want to receive comments for a specific publication, but all comments are within the time range.
SELECT fromid, time FROM comment WHERE post_id IN (SELECT post_id FROM stream WHERE source_id = '.$wallid.')
This will return about 50 comments. When I add the following:
AND time > 1309478400
I also get comments. BUT with the following (2011-07-01 - 2011-07-02) I return an empty array:
AND time > 1309478400 AND time < 1309564800
When I do not add temporary conditions, it seems that I can return more than 50 comments by running several queries with an additional restriction:
... LIMIT 0, 50
... LIMIT 50, 50
But these restrictions will not work properly with my temporary condition.
So, has anyone done something similar already, or can someone explain under what circumstances restrictions work and when not?