2

I am trying to read a user's stream using the facebook graph api. the call is:

https://graph.facebook.com/me/home?access_token=xxxxx&since=yyyyy I am getting a response but there are a few problems:

  1. The result I get as a response is not identical to the stream I see as a facebbok user (many posts are missing - on facebook page, in the news feed, i can see much more posts than i get back in the response)

  2. It seems that even if I use the "since" parameter, many of the posts returned are out of the time scope. Any ideas why? I would like to do paging according to specific time periods but it seems facebook api is not working as expected (it will return results earlier than the "since" parameter and it will not return all the posts i can see in my news feed).

thanks

Lior Graf
  • 163
  • 1
  • 10

1 Answers1

0

It's easy to get these two connections from the user graph API object confused.

  • me/home is for the user's news feed
  • me/feed is for the user's wall

I would suggest using FQL via the Graph API and poll the stream table directly:

fql?q=SELECT post_id, comments, message FROM stream where source_id=me()

I'm pretty sure there's a bug logged at developers.facebook.com/bugs for the since parameter not working as expected.

DMCS
  • 31,720
  • 14
  • 71
  • 104
  • thank u for your input. i ran the following FQL: SELECT post_id, actor_id, target_id, message FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND is_hidden = 0 from the link "http://developers.facebook.com/docs/reference/fql/stream/" it seems to better retrieve the desired posts. i will further investigate the matter – Lior Graf Jan 15 '12 at 16:53
  • Try limiting it to both created_time > date AND created_time < date. I'm seeing some strange behaviour where I cant find posts older than a certain date. Maybe it's some new API limitation. – DMCS Jan 16 '12 at 14:40
  • i was able to retrieve results using just "created_time > date" though. One thing i paid attention to is that u have to cut the milliseconds part of the UNIX epoch time (last 3 digits) in order to get reasonable results. otherwise, facebook returned me an empty response – Lior Graf Jan 16 '12 at 16:57
  • FYI, There seem to be general issues with FQL and stream using LIMIT and STREAM. See http://stackoverflow.com/a/10036079/255961. – studgeek Apr 05 '12 at 21:12
  • Using FQL, there are pretty small limits: "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." from [FQL stream documentation](http://developers.facebook.com/docs/reference/fql/stream/). – Michael Oct 02 '12 at 15:07