Ajay_Kumar
Ajay_Kumar

Reputation: 1387

How to write FQL to fetch news feeds

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

Upvotes: 2

Views: 5189

Answers (2)

Jhon Andrew
Jhon Andrew

Reputation: 188

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

Upvotes: 0

Niklas
Niklas

Reputation: 30012

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.

Upvotes: 7

Related Questions