如何使用 Tumblr API 获取用户的 Tumblr 仪表板?



我在我的应用程序中使用Jumblr(Tumblr API for Java(从Tumblr获取所有仪表板帖子。但我只得到 20 个帖子作为回报。我想增加限制。我已经查看了Jumblr文档 请帮我解决这个问题。

我的代码如下:

JumblrClient client = new JumblrClient(consumer_key, consumer_secret);
client.setToken(OAuthToken, OAuthSecretToken);
// Write the user's name
List<Post> posts = client.userDashboard();
System.out.print("t"+posts.toString());
for (int i = 0; i<posts.size();i++) {
System.out.println("t" + posts.get(i).getBlogName());
System.out.println("t" + posts.get(i).getType());
System.out.println("t" + posts.get(i).getPostUrl());
}

我在Jumblr文档中找到了我问题的解决方案。我必须将options参数传递给userDashboard().

Map<String, Integer> options = new HashMap<String, Integer>();
options.put("limit", 50);
List<Post> posts = client.userDashboard(options);

最新更新