1
votes

is there a way to get newsfeed and its comments with the new changes facebook making on july, 2013 - https://developers.facebook.com/roadmap/

What im trying to do?

i want to fetch latest newsfeed with comments (if any comments on it) with one api call, even if its group api call.

Old Way of doing it:

1) fetching from stream table with comments field (comment field is deprecated now)

2) fetching from graph with comments field (which is removed also now)


Quick Links

1
Are you sure about the removal of comments field from Graph API? Cause I can still get it over the Graph Explorer. Any link about that removal?Anvesh Saxena
ya you can still get it until july, check roadmap developers.facebook.com/roadmap and also updated docs, its not there anymore.Basit
I enabled the migration for one of my app, and tested the same on Graph Explorer, it still gets me comments field. I have option to choose it to be either toplevel or stream. If possible could you please point me to the documentation where this might be mentioned.Anvesh Saxena
on developers.facebook.com/roadmap - july 10, 2013 breaks Deprecating 'comments' field from 'stream' FQL tableBasit
ya it works for me too after migration enabled. so i'm not sure whats going on. they also have issue with unlike, if you unlike, it will return 200 error. basically at the moment, you can like, but you cant unlike, because of error from this migration. so i thought this could be bug too. its better to be prepared, then be sorry for later on.Basit

1 Answers

2
votes

How about using fql? You no longer worry because what you need is get post_id from stream:

{"query1":"SELECT post_id, actor_id, created_time, message FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed') AND created_time<=now() LIMIT 5 ","query2":"SELECT post_id, id, fromid, time, text, user_likes, likes FROM comment WHERE post_id IN (SELECT post_id FROM #query1) LIMIT 5 ","query3":"SELECT id, name, pic_square FROM profile WHERE id IN (SELECT actor_id FROM #query1) or id IN (SELECT fromid FROM #query2)"}

Please test with graph API explorer(migration settings of "July 2013 Breaking Changes" is enable), it works as expected(Of course, you need granted permission read_stream).