简体   繁体   中英

Facebook4j: Get feed from user excluding posts by other users

I'm trying to fetch the latest posts of a few users using a batch request:

new BatchRequest(RequestMethod.GET, USERID/feed?limit=5&fields=from,created_time,message")

The problem is that it does not only return posts done by this user, but also posts posted to his timeline by others. As this person is quite popular, these are a lot.

The following works

if(post.getFrom().getId() == USERID)

but is more of a workaround than a real solve of this problem. Is there a better approach to only get posts done by this user?

I figured it out by myself:

I made the wrong assumption that I dealt with a user, not a page. The correct batch response to get only posts made by the page simply is:

new BatchRequest(RequestMethod.GET, PAGENAME/posts?limit=5&fields=from,created_time,message")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM