Search code examples
androidtumblrjumblr

Getting html of tumblr post using jumblr


I am developing my first Android application using the "jumblr" library to get the last post of a blog and then do some stuff.

The library is really easy to use. I create a jumblr client and insert keys, tokens and all the commands I tried to run worked.

Using

client.blogPosts("blogname.tumblr.com")

I get a list of posts but the problem comes when I try to get the text of one post, there are no methods allowing me to do this.

Am I missing something? Is this the wrong way to approach the problem?


Solution

  • I solved the problem casting the post to a TextPost.

    List<Post> posts = client.blogPosts("blogname.tumblr.com");
    String post = (TextPost)posts.get(0).getBody();