Git Product home page Git Product logo

jumblr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jumblr's Issues

Is there a way to get ALL notes for a post?

I am writing a program that needs to access all notes for a post. After getting them, it gets rid of likes and reblogs that are not by blogs the user is interested in, and then uses the extracted reblogs to get a kind of "conversation" view of all the reblogs.

Unfortunately, tumblr's API seems to limit the total number of notes that can be retrieved, and that there is no way to get all notes for a post. I hope I am wrong though.

So my question is : is there a way to easily retrieve all notes of a post or, at least, all notes from specific blogs?

Add getReason() in JumblrException

Currently, JumblrException only gives access to the error code and the very imprecise error message like "Bad Request". Therefore please add something like getReason() for getting the "errors" string in the "response" array included in the returned json string.

getReason() should therefore return something like "Oh no! You've reached your photo upload limit for today."

The tumblr guys should have made a better job in designing the API for notifying users of API limit hits IMHO.

Post.class missing getLikedTimestamp()

I can see this in the source code (on GitHub), and I can see where it was "Commits on Dec 5, 2014" that it was added (#51). However, when I browse the compiled 0.11 jar file (produced on Dec 15, 2014) it lists:

getDateGMT() : String
getTimeStamp() : Long
getType() : String

According to the code source, from what I can tell, it should be right after getTimeStamp and right before getType.

Just checked the "release source code" at https://github.com/tumblr/jumblr/releases/tag/jumblr-0.0.11 and it turns out this fix was NOT included in this release.

As I am relatively new to GitHub, do I need to pull the source down and compile it in order to create a jar file? or is there an "beta" jar file of the current source code that is accessible some place?

Thanks, Linus

JSON output

It would be really nice to have the possibility to have unparsed json output, too, like Twitter4J acttually does.

This will bring more flexibility to the API (for example, to build a flume source connector for hadoop ingestion). I tried to do it by myself but it's by far a too complex patch for my knowledge.

I hope this feature will be considered, sooner or later!

regards,
gabriele

Unchecked casts in JumblrClient

Java throws some warnings on compiling:

../libs/jumblr.jar(com/tumblr/jumblr/JumblrClient.java):100: warning: [unchecked] unchecked cast
        Map<String, String> soptions = (Map<String, String>) options;
                                                             ^
  required: Map<String,String>
  found:    Map<String,CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
../libs/jumblr.jar(com/tumblr/jumblr/JumblrClient.java):142: warning: [unchecked] unchecked cast
        Map<String, String> soptions = (Map<String, String>)options;
                                                            ^
  required: Map<String,String>
  found:    Map<String,CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
../libs/jumblr.jar(com/tumblr/jumblr/JumblrClient.java):161: warning: [unchecked] unchecked cast
        Map<String, String> soptions = (Map<String, String>) options;
                                                             ^
  required: Map<String,String>
  found:    Map<String,CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
../libs/jumblr.jar(com/tumblr/jumblr/JumblrClient.java):323: warning: [unchecked] unchecked cast
        Map<String, String> soptions = (Map<String, String>)options;
                                                            ^
  required: Map<String,String>
  found:    Map<String,CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
../libs/jumblr.jar(com/tumblr/jumblr/JumblrClient.java):340: warning: [unchecked] unchecked cast
        Map<String, String> sdetail = (Map<String, String>)detail;
                                                           ^
  required: Map<String,String>
  found:    Map<String,CAP#1>
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
5 warnings

Inconsistent encoding

Currently Jumblr MultipartConverter uses default system encoding for message body (message.getBytes()), that could be 8859-1 on some systems. Scribe, at same time, always use UTF-8 for signature (message.getBytes("UTF-8")).

So, on a system with non-UTF8 encoding it fails to work. On Auth step, but anyway, it cannot prepare valid request for non-latin post on such JVM.

Not Authorized exception while posting Photo

Hi, while i'm posting TextPost

TextPost tp = tumblrObj.newPost(tumblrObj.user().getBlogs().get(0).getName(), TextPost.class);
tp.setTitle("Title");
tp.setBody(msg);
tp.save();

it works well but if I change it to PhotoPost

PhotoPost pp = tumblrObj.newPost(tumblrObj.user().getBlogs().get(0).getName(), PhotoPost.class);
pp.setCaption(msg);
pp.setLinkUrl(link);
pp.setSource(mImage); //String URL
//pp.setPhoto(new Photo(mImage));
pp.save();

it throws exception

com.tumblr.jumblr.exceptions.JumblrException: Not Authorized
    at com.tumblr.jumblr.request.RequestBuilder.clear(RequestBuilder.java:123)
    at com.tumblr.jumblr.request.RequestBuilder.postMultipart(RequestBuilder.java:56)
    at com.tumblr.jumblr.JumblrClient.postCreate(JumblrClient.java:352)
    at com.tumblr.jumblr.types.Post.save(Post.java:331)

Error when reblog a post

I just start with Jumblr and i got an error ( NullPointer ) when i reblog a post.

The problem happens because we try to parse the json object "post" while one recovers only the new post id.

I made two changes:

JumblrClient.java : Edit postReblog()

    public Post postReblog(String blogName, Long postId, String reblogKey, Map<String, ?> options) {
        if (options == null) {
            options = new HashMap<String, String>();
        }
        Map<String, Object> soptions = JumblrClient.safeOptionMap(options);
        soptions.put("id", postId.toString());
        soptions.put("reblog_key", reblogKey);

        // Edit here
        Long id = requestBuilder.post(JumblrClient.blogPath(blogName, "/post/reblog"), soptions).getIdFromReblog();
        return this.blogPost(blogName, id);
    }

ResponseWrapper.java : Add getIdFromReblog()

    public Long getIdFromReblog() {
        Gson gson = gsonParser();
        JsonObject object = (JsonObject) response;

        return gson.fromJson(object.get("id").toString(), Long.class);
    }

And the probleme has been solved ;)

Built jar missing

Hello
I simply wanted to point out that the link to the built jars is a dead link and the jars are missing.
Best regards

Can't accept other lanuage except English ?

map.put("type", "text");
map.put("body", "body");
map.put("tags", "tags1, tag2, 日本語");
client.postCreate(client.user().getName(), map);

At this map, the body and the tags only accept english words ?
if the body and tags contains other lanuage words, for example, Asia lanuage words,French lanuage words and Spanish lanuage, Run the above code, will appea
a Exception.
com.tumblr.jumblr.exceptions.JumblrException: Not Authorized
You can try it.

Implement Photoset Support

Please add support for Photosets in the PhotoPost Class, as well as needed Methods in the Photo Class, like

setSource()
setData()
setHeight()
setWidth()

to comply the API.
PhotoPost methods setSource() and similar should be migrated to Photo to avoid redundancy.
PhotoPost needs a method setPhotos()

That's how I would expect it. Feel free to implement it another way.

OAuthConnection Exception

Hi everyone !
Is anyone experiencing problems with Jumblr API today?
Exception in thread "main" org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
at org.scribe.model.Request.send(Request.java:69)
at org.scribe.model.Request.send(Request.java:75)
at com.tumblr.jumblr.request.RequestBuilder.get(RequestBuilder.java:92)
at com.tumblr.jumblr.JumblrClient.userFollowing(JumblrClient.java:104)
at com.tumblr.jumblr.JumblrClient.userFollowing(JumblrClient.java:107)
Caused by: java.net.ConnectException: Connection timed out: connect

com.tumblr.jumblr.exceptions.JumblrException: Not Authorized when performing PhotoPost.save()

Hi,

I'm getting this exception message: "com.tumblr.jumblr.exceptions.JumblrException: Not Authorized" when I try to perform a PhotoPost.save();

How to reproduce:

  1. I have my consumer key and consumer secret ready
  2. Obtained the token and token secret through web browser: https://api.tumblr.com/console/calls/user/info
  3. Run the codes below with token and tokenSecret obtained hard coded:
    JumblrClient client = new JumblrClient(consumerKey, consumerSecret);
    client.setToken(token, tokenSecret);

PhotoPost photoPost = client.newPost( "myblogname", PhotoPost.class );
photoPost.setId( 1232 );
photoPost.setPhoto( new Photo( "http://somedomain.com/somephoto.jpg" ) );
photoPost.setLinkUrl( "http://someotherdomain.com/1234" );
photoPost.setCaption( "Test Photo Title" );
photoPost.save(); // It is this line which throws an exception.

Would appreciate anybody could look into this. Thanks.

Jumblr getType on a Post returns null

Jumblr returns null instead of the correct type String when calling getType on a Post object. This is because the type string is hardcoded in a details HashMap per Post type. The type should be set on each Post type and be returned correctly to callers.

final TextPost post = client.newPost(blogName, TextPost.class);
post.getType()
// -> null instead of 'text'

The above code should return text

Brought to my attention in this thread

Can't get info out of userDashboard()

Hi! Thanks for writing Jumblr it's awesome. I'm trying implement an android application that can display my dashboard- trying to get information out of the posts on my dash. However, when I try to do getType(), an empty string is returned. Is that a problem with my code, or Jumblr?

Thanks so much.

    JumblrClient client = new JumblrClient(consumerKey, consumerSecret); 
    client.setToken(oAuthToken, oAuthSecret);
    List<Post> posts = client.userDashboard();
    for (int i = 0; i < posts.size(); i++){
    Post post = (Post) posts.get(i);
    String postStr = post.toString();
    Log.e("Post Type", post.getType());
    Log.e("Author", post.getAuthorId());

EXCEPTION FAILED TO EXECUTE GOAL ORG.CODEHOUSE

my build stopped by giving an exception Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project jumblr: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1] can anyone help me in this?

The number following

Hi, I am using your ‘jubmlr’ api to develop an app. When I use the method (‘userFollowing’) to get the blogs what I am following, the number of the blogs isn't equal to my account’following. My account’s following is 228, but the number I got from the ‘jubmlr’ is 20. So is there any limitation to the api?

Oauth

Sorry if this is stupid, but I'm new to OAuth. How do I get an oauth_token and oauth_token_secret?

No public Javadocs

The code has documentation, and I can generate the Javadoc once I've downloaded the project, but it would be nice if there was a public hosted Javadoc site.

Can someone help me about this error?

Use Jumblr to develop an android app.
I got token and secret successfully, and I can get my following blogs' infos.
But the logcat output some error:
E/NativeCrypto: ssl=0x7f58062880 cert_verify_callback x509_store_ctx=0x7f62ebed78 arg=0x0
E/NativeCrypto: ssl=0x7f58062880 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA

Reblog info?

I just started using jumblr, and I love it, and I have a feature request. Could you add the ability to see what a given post was reblogged from (i.e., the information available by setting reblog_info in the normal API)?
(Sorry if feature requests don't go here.)

Note info

I'm not sure if I'm missing something, but I don't see a way to get the notes associated with a post, even if we pass in true for the "notes_info" parameter. Please let me know if this is possible. Thank you!

Add setDate for Post

Changing the date of a Post is currently only possible after saving it via editing it later.
Please add a method setDate(Date) for setting the Date of a Post object.

PhotoPost by source url don't get saved in "queued" state

Hey. I am not sure what I am doing wrong here. Everything works fine except that my posts are getting saved in a published state instead of queued. No exceptions are thrown.

This is my method.

public void postImage(String imageSource, String text) throws IOException {
  try {
            PhotoPost post = clientToPostWith.newPost(
                    blogname, 
                    PhotoPost.class);
            post.setCaption(text);
            post.setState("queued");
            post.setPhoto(new Photo(imageSource));
            post.save();
            System.out.println(post.getState());
            System.out.println(clientToPostWith.blogPost(blogname, post.getId()).getState());
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        }
    }
}

The output is:

queued
published

Question: New release soon?

Don't mean to be a pain, but.... I'm starting on an extensive change to one of my programs and was wondering if a new release of jumblr is scheduled. If so, I'd be happy to help with whatever testing I can provide.

Possible issue connecting to api.tumblr.com

First of all thank you for an awesome tumblr api wrapper - helped save a lot of work.
recently i tried working with the jumblr lib and got an exception message that says; 'Not Found'. Didn't know what was going on at the time but doing some manual http request over the browser I tried this path(api.tumblr.com/console//calls/user/info) on both 'https' and 'http' and both produced different results. The non secure gave me a JSON with a 'Not Found' ({"meta":{"status":404,"msg":"Not Found"},"response":[]}) message - what the lib previously gave me.
Now requesting the URL over https went through without issues.
Question then is can't the lib make https requests to the tumblr api instead of http?

== Exception message ==
com.tumblr.jumblr.exceptions.JumblrException: Not Found
at com.tumblr.jumblr.request.RequestBuilder.clear(RequestBuilder.java:120)
at com.tumblr.jumblr.request.RequestBuilder.get(RequestBuilder.java:69)
at com.tumblr.jumblr.JumblrClient.blogInfo(JumblrClient.java:118)

Thanks,

Post attribute 'reblogged_root_name' not in Jumblr

reblogged_root_name is useful to find the original poster (with reblog_info) but is not available in Jumblr.

Its counterpart, reblogged_from_name, shows who you reblogged the post from and is available.

Missing Video URL

The VideoPost type is missing the definition and return of the field video_url. I have copied the source, added the minor changes required and tested the changes from within my application. I have submitted pull request for this change.

I think I did it right. But if I didn't, please let me know what I did wrong so that I can better contribute any further updates I might encounter.

Jumblr on Google App Engine - java.lang.SecurityException

Jumblr does not work in an app deployed on Google App Engine, owing to Gson and the way it uses/depends on Reflection.

Below is a stack trace detailing the problem:
java.lang.SecurityException: java.lang.IllegalAccessException: Reflection is not allowed on private java.lang.String java.io.File.path
at com.google.appengine.runtime.Request.process-bc4f433d60aeb55d(Request.java)
at java.lang.reflect.Field.setAccessible(Field.java:166)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:116)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.(ReflectiveTypeAdapterFactory.java:82)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:118)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
at com.google.gson.Gson.getAdapter(Gson.java:353)
at com.google.gson.Gson.fromJson(Gson.java:794)
at com.google.gson.Gson.fromJson(Gson.java:859)
at com.google.gson.Gson$2.deserialize(Gson.java:131)
at com.tumblr.jumblr.responses.PostDeserializer.deserialize(PostDeserializer.java:22)
at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.Gson.fromJson(Gson.java:795)
at com.google.gson.Gson.fromJson(Gson.java:859)
at com.tumblr.jumblr.responses.ResponseWrapper.getPosts(ResponseWrapper.java:45)
at com.tumblr.jumblr.JumblrClient.blogPosts(JumblrClient.java:169)
at com.tumblr.jumblr.JumblrClient.blogPosts(JumblrClient.java:173)

Unable to get user info

Using:
consumer = new CommonsHttpOAuthConsumer(APP_CONSUMER_KEY, APP_CONSUMER_SECRET);
provider = new CommonsHttpOAuthProvider("http://www.tumblr.com/oauth/request_token",
"http://www.tumblr.com/oauth/access_token", "http://www.tumblr.com/oauth/authorize");
provider.setOAuth10a(true);
try
{
authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);
}

After getting token and secret, I am calling

api = new JumblrClient(TumblrLoginActivity.APP_CONSUMER_KEY, TumblrLoginActivity.APP_CONSUMER_SECRET);
api.setToken(consumer.getToken(), consumer.getTokenSecret());

LOG error:

09-26 16:13:02.093: E/AndroidRuntime(9067): org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
09-26 16:13:02.093: E/AndroidRuntime(9067): at org.scribe.model.Request.send(Request.java:66)
09-26 16:13:02.093: E/AndroidRuntime(9067): at org.scribe.model.OAuthRequest.send(OAuthRequest.java:12)
09-26 16:13:02.093: E/AndroidRuntime(9067): at com.tumblr.jumblr.request.RequestBuilder.get(RequestBuilder.java:69)
09-26 16:13:02.093: E/AndroidRuntime(9067): at com.tumblr.jumblr.JumblrClient.user(JumblrClient.java:64)
09-26 16:13:02.093: E/AndroidRuntime(9067): at com.ta.hhh.instumentals.APIRequestThread.apiRequest(APIRequestThread.java:123)
09-26 16:13:02.093: E/AndroidRuntime(9067): at com.ta.hhh.instumentals.APIRequestThread.run(APIRequestThread.java:71)
09-26 16:13:02.093: E/AndroidRuntime(9067): Caused by: java.io.IOException: No authentication challenges found
09-26 16:13:02.093: E/AndroidRuntime(9067): at libcore.net.http.HttpURLConnectionImpl.getAuthorizationCredentials(HttpURLConnectionImpl.java:438)
09-26 16:13:02.093: E/AndroidRuntime(9067): at libcore.net.http.HttpURLConnectionImpl.processAuthHeader(HttpURLConnectionImpl.java:418)
09-26 16:13:02.093: E/AndroidRuntime(9067): at libcore.net.http.HttpURLConnectionImpl.processResponseHeaders(HttpURLConnectionImpl.java:367)
09-26 16:13:02.093: E/AndroidRuntime(9067): at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:301)
09-26 16:13:02.093: E/AndroidRuntime(9067): at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497)
09-26 16:13:02.093: E/AndroidRuntime(9067): at org.scribe.model.Response.(Response.java:29)
09-26 16:13:02.093: E/AndroidRuntime(9067): at org.scribe.model.Request.doSend(Request.java:106)
09-26 16:13:02.093: E/AndroidRuntime(9067): at org.scribe.model.Request.send(Request.java:62)
09-26 16:13:02.093: E/AndroidRuntime(9067): ... 5 more

java.lang.IllegalStateException: Expected NUMBER but was BOOLEAN

I have got this exception with this simple code:

JumblrClient jClient = ...
Post post = jClient.blogPost("gregorymosby", 110521489824L);

Output:

Exception in thread "main" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected NUMBER but was BOOLEAN
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
    at com.google.gson.Gson.fromJson(Gson.java:795)
    at com.google.gson.Gson.fromJson(Gson.java:859)
    at com.google.gson.Gson$2.deserialize(Gson.java:131)
    at com.tumblr.jumblr.responses.PostDeserializer.deserialize(PostDeserializer.java:22)
    at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:58)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
    at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
    at com.google.gson.Gson.fromJson(Gson.java:795)
    at com.google.gson.Gson.fromJson(Gson.java:859)
    at com.tumblr.jumblr.responses.ResponseWrapper.getPosts(ResponseWrapper.java:45)
    at com.tumblr.jumblr.JumblrClient.blogPosts(JumblrClient.java:189)
    at com.tumblr.jumblr.JumblrClient.blogPost(JumblrClient.java:205)

Checking manually the JSON, I have noticed that there is something wrong with the retrieved JSON of that post:

"thumbnail_width":false
"thumbnail_height":false

where a 'numeric' (int/long) is expected.

Error when retrieve a blog's followers

I tried to retrieve a blog's followers via this guideline : https://api.tumblr.com/console//calls/blog/followers

But, errors occurred :
Caught: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected NUMBER but was BOOLEAN
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected NUMBER but was BOOLEAN
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:81)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
at com.google.gson.Gson.fromJson(Gson.java:803)
at com.google.gson.Gson.fromJson(Gson.java:868)
at com.tumblr.jumblr.responses.ResponseWrapper.getUsers(ResponseWrapper.java:54)
at com.tumblr.jumblr.JumblrClient.blogFollowers(JumblrClient.java:127)
at com.tumblr.jumblr.JumblrClient.blogFollowers(JumblrClient.java:130)
at com.tumblr.jumblr.JumblrClient$blogFollowers$0.call(Unknown Source)
at aa.infomio.social.PhatTest.run(PhatTest.groovy:59)
Caused by: java.lang.IllegalStateException: Expected NUMBER but was BOOLEAN
at com.google.gson.internal.bind.JsonTreeReader.nextInt(JsonTreeReader.java:195)
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:239)
at com.google.gson.internal.bind.TypeAdapters$7.read(TypeAdapters.java:231)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)

setCaption() encoding problem

I use Jumblr in my Android project and I have a problem. When I setCaption for PhotoPost with English characters like "Testing posting captioning" it works fine. But when I setCaption with some Polish diacritics, like "óżź" etc. I have this error.

java.lang.ArrayIndexOutOfBoundsException: src.length=330 srcPos=0 dst.length=196607 dstPos=196291 length=330

The problem is caused by this function in MultipartConverter:

private byte[] complexPayload() {
    int used = 0;
    byte[] payload = new byte[bodyLength];
    byte[] local;
    for (Object piece : responsePieces) {
        if (piece instanceof StringBuilder) {
            local = ((StringBuilder) piece).toString().getBytes();
        } else {
            local = (byte[]) piece;
        }
        System.arraycopy(local, 0, payload, used, local.length);
        used += local.length;
    }
    return payload;
}

Readme Travis status image includes builds from feature branches

Readme should use https://travis-ci.org/tumblr/jumblr.png?branch=master instead of https://travis-ci.org/tumblr/jumblr.png to avoid confusion as the latter includes builds from feature branches and could display an error even when the master branch passes (which it's doing right now).

Rate Limit?

Hi.

Earlier today this code worked on an Android:

final File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), SELFIE_FILE_NAME);
PhotoPost mPP = mTumblrClient.newPost("memememeselfie.tumblr.com", PhotoPost.class);
mPP.setData(file);
mPP.save();

Now it's crapping out with the following exception:

com.tumblr.jumblr.exceptions.JumblrException: Bad Request

I'm guessing this is from rate limiting because the exact same code works on a different blog with a different user.

Are there rate limits? What are they?

Does the API return any kind of info if you are being rate limited, so the exception could be more specific? Because Bad Request can mean too many other things...

Thanks.

Is it possible to get total_posts of post list?

Hi,
I can't find a method to get total_posts.
For example, I have a blog has 37 posts in total.
13 posts have tag "travel".
I use blogPosts(String blogName, Map<String,?> options) to get posts with tag "travel" and the limit sets to 5.
I can count List to get 5, but can't get the total_posts which should be 13.
Please help to make an enhancement.
Thanks.

Incompatible with Proguard?

W/System.err﹕ java.lang.ClassCastException: com.google.c.b.v cannot be cast to com.tumblr.jumblr.types.Blog at com.tumblr.jumblr.types.User.getBlogs(SourceFile:63)

This error is thrown when trying to perform user.getBlogs()

Initially, I couldn't even do client.getUser() until I added jumblr as a package to keep in the proguard settings file.

I stepped through the getBlogs() method and the data inside the list of blogs was correct, it just threw this when the method attempted to iterate through the list with a foreach loop.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.