2

I have to fetch all data which is on News Feeds (public wall). What query should I write ? I wrote "SELECT likes,message FROM stream WHERE source_id = %lld limit 50 " query but it is returning my wall value. I want to fetch all data which is on my wall as well as on public (News Feed).

Thanks in advance

James Ford
  • 1,543
  • 2
  • 15
  • 31
Ajay_Kumar
  • 1,381
  • 10
  • 34
  • 62
  • 1
    I think you need to expand that query with a subquery, to include items where the source_id is also from friends and pages that the user has "Liked". Does that sound like what you're after? – James Ford Jul 04 '11 at 10:50

2 Answers2

7

You need to use the filter_key to select the type of feed to use. The type you are after would probably be newsfeed, so the query could be something like this:

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')

For more information, have a look at the stream_filter docs.

Niklas
  • 29,752
  • 5
  • 50
  • 71
  • 1
    works for me.. updated slighly as per example on facebook site, see in action on the graph explorer here http://developers.facebook.com/tools/explorer/?method=GET&path=fql%3Fq%3DSELECT%20post_id%2C%20actor_id%2C%20target_id%2C%20message%20FROM%20stream%20WHERE%20filter_key%20in%20(SELECT%20filter_key%20FROM%20stream_filter%20WHERE%20uid%3Dme()%20AND%20type%3D'newsfeed')%20AND%20is_hidden%20%3D%200 – Tom May 31 '12 at 11:13
0

How about doing it without querying FQL? :)

Use the Graph API instead:

https://graph.facebook.com/me/home?access_token=...

Try it on using "Graph API Explorer". /me/home

Jhon Andrew
  • 188
  • 3
  • 14