// Parse the credentials
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(json.toString());
// Create a client
JumblrClient client = new JumblrClient(
obj.getAsJsonPrimitive("consumer_key").getAsString(),
obj.getAsJsonPrimitive("consumer_secret").getAsString()
);
// Give it a token
client.setToken(
obj.getAsJsonPrimitive("oauth_token").getAsString(),
obj.getAsJsonPrimitive("oauth_token_secret").getAsString()
);
// Usage
List<Post> posts = client.blogPosts("seejohnrun");
for (Post post : posts) {
System.out.println(post.getShortUrl());
}
}