FQL query on stream table returns empty using created_time - facebook

I have a FQL query for the stream table as follows
SELECT post_id FROM stream WHERE filter_key ='nf' AND created_time < 1335500000
Where the filter_key grabs the news feed. This query returns no data (for my account)
Where as, this query (using unix set at April 30 2012)
SELECT post_id FROM stream WHERE filter_key ='nf' AND created_time < 1335758400
Returns data.
I can keep pushing the unix time back to a point until it just stops showing data, yet there is data there from just browsing my news feed manually through the Facebook UI.
The stream docs state
Each query of the stream table is limited to the previous 30 days or 50 posts, whichever is greater, however you can use time-specific fields such as created_time along with FQL operators (such as < or >) to retrieve a much greater range of posts.
So to me, it means I can do "pagination" with created_time and limit.
This isn't the case.
Even using the alternative /me/home returns the first set but when I use the pagination links there is no data returned.
Is there something I missing here? Maybe some explanation as to why the previous data is empty for both the FQL and Graph API calls?

Related

Giving Multiple Ids for stream in facebook FQL

select post_id, message from stream where source_id IN (..., ..., ...) LIMIT 500
I'm using this fql query but it is returning just few posts. While the below query is returning more than 200 posts.
select post_id, message from stream where source_id = ... LIMIT 500
but giving same id with other id is returning 4 to 5 posts.
I know fql support is not available in v2.0 but still I want to do this using fql.
This seems strange... Have you tried doing this via pure Graph API? What kind of objects are you using as source_ids?
GET /?ids={object_id_1},{object_id_2},{object_id_3}&fields=feed.fields(id,message).limit(100)

Get all the posts the user liked for a specific period

I would like to know if it's possible to get, for example, all the posts that the user liked for the last 6 month.
Tell me if I'm wrong but this query is supposed to return all posts I liked :
SELECT object_id, post_id FROM like WHERE user_id = me()
I don't see how to filter the result.
You cannot grab the post_id that easily from the like table. The ONLY way to get a post_id is querying it from the stream table. This is no arbitrary query.
Here is how you should be thinking about it.
First you have to grab the posts from your stream that were posted by the "owner" since that's the easiest way to arbitrarily grab a bunch of posts that you care about.
select post_id
FROM stream
WHERE filter_key="owner"
Then you have to use that result to check if those post_ids are in your like table AND you're the user that liked them:
select post_id
FROM like WHERE
post_id in (select post_id from stream where filter_key="owner"
and created_time> *timestamp from a week ago*)
AND user_id=me()

Facebook fql stream table limit

On facebook API reference for FQL stream table you can find that "Each query of the stream table is limited to the previous 30 days or 50 posts, whichever is greater, however you can use time-specific fields such as created_time along with FQL operators (such as < or >) to retrieve a much greater range of posts."
But if I use siple query
SELECT message FROM stream WHERE source_id = me() LIMIT 500
I get far more than 50 posts. So is it enough only to use LIMIT to get more than 50 posts?

Query every liked object using FQL

I'm trying to query every object which the user has liked since joining facebook by running this query:
SELECT user_id, object_id, post_id FROM like WHERE user_id=me()
This query runs fine and returns some results, but the number of them is a lot less than I estimated. I tried it on different, real user accounts, and for a friend of mine who has joined facebook around 2006 the number of returned results is still only around 65.
I tried this query through the official javascript sdk and through the graph api explorer which gave identical results.
The documentation doesn't state any limit imposed upon querying the like table.
Is there anything, I should be aware when doing a query on this table?
Thank you very much!
According to this documentation :
Each query of the stream table is limited to the previous 30 days or
50 posts, whichever is greater, however you can use time-specific
fields such as created_time along with FQL operators (such as < or >)
to retrieve a much greater range of posts.
Although not explicitly mentioned in the doucmentation for likes, I guess this will be the same limit. So try to add created_time in a where clause.

FQL query: query with multiple stream_id gives too few records

I would like to query public posts from multiple Pages.
My FQL query looks like this:
SELECT post_id, source_id FROM stream WHERE source_id in (157528807603192, 127531603328)
This query returns only about 6 records.
However, if I use the two source_id in two separate query I got more than 20 item for both of them:
SELECT post_id, source_id FROM stream WHERE source_id in = 157528807603192
I couldn't find anything in the documentation stating that if you query multiple source_id you need different permissions.
Can anyone explain me what is happening here?
I've found the answer in the documentation. :(
http://developers.facebook.com/docs/reference/rest/stream.get/
"If you specify only one user ID in the source_ids array, you can
return, at minimum, the last 50 posts from that user's profile stream
(Wall) for the last 180 days (it likely can be more).
If you specify more than one user ID in the source_ids array, you can
return posts in those streams only from the last few days (about one
week)."