tumblr / jumblr Goto Github PK
View Code? Open in Web Editor NEWTumblr API v2 Java Client
License: Apache License 2.0
Tumblr API v2 Java Client
License: Apache License 2.0
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.
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
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.
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.
Add convenience methods for uploading data
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?
Hi,
Could you consider to bump org.scribe to com.github.scribejava?
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)
a nicer factory interface for creating posts
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
I want to ask you, if I use the jumblr, should I get OAuth token by myself or this can be done by jumblr?
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.
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.
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).
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)
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
http://api.tumblr.com/v2/blog/MYBLOG/posts?limit=5&tag=Competitions&api_key=Myapikey&_=1392657520582
returns a json string which can include "short_url"
When the response is parsed with gson, any "short_url" field is lost as it isn't present in any of the response wrappers:
com.tumblr.jumblr.types.TextPost
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?
The API is currently limited to only reading the Photo image from a file. It would be nice to have other options available.
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());
The Note class is missing note information that only certain types have, like added_text for reblog notes and reply_text for reply notes
JavaDoc: http://tumblr.github.io/jumblr/javadoc → 0.0.8
Releases: https://github.com/tumblr/jumblr/releases → 0.0.11
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.
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.
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.
Hi everyone,
JTumblr failled to get Information about the authenticating user! com.tumblr.jumblr.exceptions.JumblrException: Not Authorized
at com.tumblr.jumblr.JumblrClient.user(JumblrClient.java:83)
Thanks in advance.
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;
}
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,
add convenience method
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:
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.
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
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.
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
Could you push it to a public maven repository ?
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)
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?
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!
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.
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
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.)
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.
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.
Sorry if this is stupid, but I'm new to OAuth. How do I get an oauth_token
and oauth_token_secret
?
Image posting is not working. Take look at my question in stackoverflow.
http://stackoverflow.com/questions/28087464/tumblr-photo-posting-by-using-jumblr/28087551#28087551
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
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.
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
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:
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);
}
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 ;)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.