Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter by post author using Facebook Graph API

Here's the problem I'm having -- I want to pull the latest 20 wall posts from a company's Facebook page using Graph API, but only those posts that were authored by that company. For instance, if I were pulling from the Grey Poupon Facebook page, I don't want any of the wall posts that their fans put up, just the ones that Grey Poupon put up.

From my vantage point, there's no way to do this, other than by pulling way too many, then cycling through each result and checking the "from" data to make sure it matches the page name till that limit hits 20. But that's awfully inefficient and still doesn't guarantee a result set of 20. Am I missing something, or is that my only option?

like image 840
atacrawl Avatar asked Oct 04 '12 20:10

atacrawl


1 Answers

What exactly are you requesting from the API – /pageid/feed, or /pageid/posts …?

The latter should only contain the page’s own posts.

Also, you could use the FQL stream table to filter by actor_id.

like image 59
CBroe Avatar answered Sep 19 '22 14:09

CBroe