user577477
user577477

Reputation: 1

Facebook 2.1 API get home feed and sort by type

I've tried searching and can't find an answer.. I've tried to get my own feed with just one or several type like "link" or "video".

I played with the facebook explorer tool, i've got my own feed with the endpoint me/home but i don't known how we can sort by type (link, status, video or photo)

Someone has an idea ?

Thanks.

Upvotes: 0

Views: 513

Answers (1)

Tobi
Tobi

Reputation: 31479

This is available in the docs, but explained a little complicated: https://developers.facebook.com/docs/graph-api/reference/v2.1/user/home/

The parameter filter can be used to

Retrieve only posts that match a particular stream filter. Valid filters to be used here can be retrieved using the FQL stream_filter table.

The docs for stream filter are here: https://developers.facebook.com/docs/reference/fql/stream_filter/ You can query your own stream filters by issueing the following FQL query:

select name, filter_key from stream_filter where uid=me()

Test it here: https://developers.facebook.com/tools/explorer?fql=select%20name%2C%20filter_key%20from%20stream_filter%20where%20uid%3Dme()&version=v2.0

This yields in the following filters (at least for me):

  • Photos: /me/home?filter=app_2305272732
  • Videos: /me/home?filter=app_2392950137
  • Links: /me/home?filter=app_2309869772
  • Statuses: /me/home?filter=app_2915120374

Upvotes: 1

Related Questions