我想设置多个分类Feed,以分段发布的内容。我有4个Feed设置用于测试:
用户和平面Feed正在使用Java API从文档中按预期工作。我可以发布到用户Feed,并能够从中检索该用户的项目。我也可以关注用户,并看到这些反映在平面Feed中。
我面临的挑战是基于一些简单的标记来分割内容。我基本上想要设置一些公共供稿并根据标签值复制帖子。这是有效的,我看到在预期的体育和足球饲料中重复发布的帖子。 (不使用,因为这似乎突破了Java包装器。)
我的问题是如何使用API来阅读Feed中的所有内容,而不仅仅是特定用户的帖子?
将项目添加到分类Feed中的代码:
//Post this to the categorized feed
SimpleActivity activity = new SimpleActivity();
activity.setActor(item.getOwnerId());
activity.setObject(item.getId());
activity.setVerb(POST_VERB);
activity.setForeignId(item.getId());
Feed theFeed = this.streamClient.newFeed(theCategory, item.getOwnerId());
//Create an activity service
FlatActivityServiceImpl<SimpleActivity> flatActivityService = theFeed.newFlatActivityService(SimpleActivity.class);
//Add an activity to the feed, where actor, object and target are references to objects
try {
SimpleActivity response = flatActivityService.addActivity(activity);
//Lets log some info on this!
LOG.debug("Item added " + response.getForeignId());
} catch (IOException e) {
LOG.warn("IOException in StreamService", e);
} catch (StreamClientException e) {
LOG.warn("StreamClientException in StreamService", e);
}
然后再读回来
Feed theFeed = this.streamClient.newFeed(theFeedCategory.getFeedId(), userId);
FeedFilter filter = new FeedFilter.Builder().withLimit(pageSize).withOffset(start).build();
FlatActivityServiceImpl<SimpleActivity> flatActivityService = theFeed.newFlatActivityService(SimpleActivity.class);
try {
List<SimpleActivity> activities = flatActivityService.getActivities(filter).getResults();
for (SimpleActivity activity : activities) {
response.add(activity.getForeignId());
}
} catch (IOException e) {
LOG.warn("IOException in StreamService", e);
} catch (StreamClientException e) {
LOG.warn("StreamClientException in StreamService", e);
}
我有没有办法通过java API来获取任何用户的Feed中的所有内容?还是有办法对Feed进行细分,以便他们在某个类别上进行转化?
由于