I'm using FQL to get the user's news feed. The query is:
SELECT post_id, actor_id, target_id, message, description,type,like_info,attachment, comment_info,created_time, share_count
FROM stream
WHERE filter_key IN (
SELECT filter_key
FROM stream_filter
WHERE uid=me()
AND type='newsfeed'
)
AND is_hidden = 0
LIMIT 50
I'm finding that the results I get are sometimes sorted by popularity (top stories) and sometimes sorted by time. This is not what I want, as I ONLY want it to be sorted by date. Oddly enough, the posts always seem to be sorted by time in the Graph API explorer, but not always when querying it outside of the Graph API explorer, like in my app (iOS).
Is there any way to specify how I need to posts to be sorted in my request?
have you tried adding this?
ORDER BY created_time
I've also noticed that when you use the LIMIT
statement at the end of an fql query, the sorting goes out the window sometimes, try adding AND created_time > <point in time>
in your where clause and only use the first 50 results and see what happens