Tumblr API for java(Jumblr),如何使用标记并获得nsfw结果

时间:2017-09-10 09:54:56

标签: java tumblr jumblr

看起来如果你使用jumblr中的tagged,所有nsfw都不会被包含在结果中。

    TumblrBot bot = new TumblrBot();
    JumblrClient jClient = bot.getjClient();
    Map<String, Object>options = new HashMap<>();
    options.put("limit", 20);
    options.put("offset", 0);
    List<Post> posts = jClient.tagged(tag, options);
    for (int i = 0; i < posts.size(); i++) {
        Post post = posts.get(i);
        System.out.println((i + 1) + " - post: " + post.getBlogName());
        System.out.println("\tnotes: " + post.getNoteCount());
    }

为了拉动nsfw标记的结果,你有什么可以放在选项中吗?

1 个答案:

答案 0 :(得分:0)

请参阅https://www.v2ex.com/t/386082

public String search(String query){
    Map<String, Object> params = new HashMap<>();
    params.put("api_key", apiKey);
    //params.put("timeline_type", "top");  // top results
    params.put("timeline_type", "recent"); //recent results
    params.put("query", query);
    params.put("block_nsfw", 0);
    if(!JumblrUtils.getInstance().getCursor().equals(""))
        params.put("cursor", JumblrUtils.getInstance().getCursor());
    return requestBuilder.get2("/timeline/search", params);

}