Giving Multiple Ids for stream in facebook FQL - facebook

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)

Related

Getting from Facebook API total number of likes per post

I'm working with the following Facebook API endpoints: /statuses, /links, /photos
For each returned object I'm only getting likes and comments objects which display top25 results, and a pagination that leads to the next 25.
I'm only interested in the number of likes. Is there a way to get that number through a different API call which doesn't require multiple pagination calls?
You can return the total number of likes for various objects using FQL. Here's the documentation for how to get the total number of likes for a comment:
https://developers.facebook.com/docs/reference/fql/comment
The query itself would look like this:
SELECT likes FROM comment WHERE post_id = xyx
SELECT like_info.like_count FROM stream WHERE source_id = '<id>'
or
SELECT like_info.like_count FROM stream WHERE source_id = '<id>' and and actor_id = '<id>'
More: https://developers.facebook.com/docs/reference/fql/stream/

Facebook FQL stream query only returning 4 items

I am trying to retrieve all Photos from a user's stream.
SELECT post_id, actor_id, target_id, message, created_time
FROM stream
WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid = me()
AND type='newsfeed')
AND type = 247
AND is_hidden = 0
ORDER BY created_time DESC
This only returns 4 results, and they are very recent posts. If I try to include a 'created_time < 1360993620' clause, it returns zero results. Is there any reason why this query does not go very far into the past?
It looks like an easier way to do what I'm trying to do is to use the Graph API to pull a user's home feed and then filter it for only the photo posts:
GET /me/home?filter=app_2305272732

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?

FQL query on stream table returns empty using created_time

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?

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)."