I have a working restfb Java program that can extract posts. But it will extract posts from everyone who posted in the wall, including the owner of the page. It is OK with less popular pages, but for popular pages, they are mostly fan posts. For example, if I extract posts from https://www.facebook.com/GameOfThrones, 199 out of 200 posts are fan posts.
I currently have a if loop to check the name of the person but sometimes the page ID is different from the post owner's ID.
Is there any generic and efficient way of doing this? I was hoping there is a parameter or something that filters out fan posts on a public page.
Here is what I have now:
FacebookClient fbclient = new DefaultFacebookClient(ACCESS_TOKEN, Version.VERSION_2_3);
Connection<Post> message = fbclient.fetchConnection(name + "/feed", com.restfb.types.Post.class, Parameter.with("limit", 200));
List<Post> detailedPost = message.getData();
....
for (int i = 0; i < detailedPost.size(); i++) {
String id = message.getData().get(i).getId();
personPosted[i] = detailedPost.get(i).getFrom().getName().toString();
if (personPosted[i].equals(name)) {
...
}
}
https://developers.facebook.com/docs/graph-api/reference/v2.3/page/feed: