0

我正在尝试使用linkedin-j API 检索我的所有网络更新。我可以获取前 10 个更新,但不知道如何再检索。

以下代码检索前 10 个更新:

Network network = client.getNetworkUpdates(EnumSet.of(NetworkUpdateType.STATUS_UPDATE));
System.out.println("Total updates fetched:" + network.getUpdates().getTotal());
for (Update update : network.getUpdates().getUpdateList()) {
        System.out.println("-------------------------------");
        System.out.println(update.getUpdateKey() + ":" + update.getUpdateContent().getPerson().getFirstName() + " " + update.getUpdateContent().getPerson().getLastName() + "->" + update.getUpdateContent().getPerson().getCurrentStatus());
        if (update.getUpdateComments() != null) {
                System.out.println("Total comments fetched:" + update.getUpdateComments().getTotal());
                for (UpdateComment comment : update.getUpdateComments().getUpdateCommentList()) {
                        System.out.println(comment.getPerson().getFirstName() + " " + comment.getPerson().getLastName() + "->" + comment.getComment());                         
                }
        }
}

还有另一种方法,network.getUpdates().getStart(),但我不知道如何实现它。我已经在这几个小时了,任何建议都将不胜感激。

4

1 回答 1

0

如果你想在linkedin-j 中使用分页,那么你可以使用getNetworkUpdates(Set, int, int) 和network.getUpdates().getTotal()。

public Network getNetworkUpdates(Set<NetworkUpdateType> updateTypes, int start, int count);
于 2014-05-05T04:58:50.223 回答