SteemJ-Image-Upload has been released ~ Upload Images to steemitimages.com out of your Java Application

Ever wondered how to upload images to Steemit? Simply use SteemJ Image Upload.


SteemJImageUploadLogo

SteemJ-Image-Upload has been released ~ Upload Images to steemitimages.com out of your Java Application

Hello Steemians!

I am more than proud to share my latest project with you: SteemJ Image Upload. This small application allows you to upload images to the official Steemit Image Hoster https://steemitimages.com out of your Java application.

It has been more than 11 months ago that I've announced the first version of SteemJ and during this long time, one of the most asked questions was:

How can I upload an image and add it to my post?

While writing a post has become really easy with SteemJ, uploading an image was still not supported. Therefore, my answer so far was to use a third party hoster like https://imgur.com, which results in additional work for the user as you need to take care of creating/finding an API for Java, create an additional account for the Hoster and much more.

So in general I think both of us, you as a user, and I as the guy behind SteemJ, were not really happy with this answer. I already know that Steemit itself is offering an Image Hoster (https://steemitimages.com) since several months, but after they removed the web interface I had no idea how to upload images now.

In the last weeks I took a lot of my free time to figure out how the upload to steemitimages.com works and some days ago I did my first successful upload! The last days have been spent to put everything into a small lib and now I feel ready to share a first pre-release with you.

The main target is, again, to collect some feedback and to find potential bugs, so if you have some time left it would be really great if you could try it out and report about it.

How can I use it - Quick Start Guide

Add SteemJ Image Upload to your project

SteemJ Image Upload binaries are pushed into the maven central repository and can be integrated with a bunch of build management tools like Maven.

File: pom.xml

<dependency>
    <groupId>eu.bittrade.libs</groupId>
    <artifactId>steemj-image-upload</artifactId>
    <version>1.0.0pre1</version>
</dependency>

Create a sample Application

SteemJ Image Upload is really easy to use. The following code shows a full sample:

import java.io.File;
import java.io.IOException;
import java.net.URL;

import eu.bittrade.libs.steemj.base.models.AccountName;
import eu.bittrade.libs.steemj.image.upload.SteemJImageUpload;

public class ExampleApplication {
    public static void main(String args[]) {
        AccountName myAccount = new AccountName("dez1337");
        // Please be informed that this is not the correct private key of dez1337.
        String myPrivatePostingKeyAsWif = "5KMamixsFoUkdlz7sNG4RsyaKQyJMBBqrdT6y54qr4cdVhU9rz7";
        File imageToUpload = new File("C:/Users/dez1337/Desktop/SteemJImageBanner.png");

        try {
            URL myImageUrl = SteemJImageUpload.uploadImage(myAccount, myPrivatePostingKeyAsWif, imageToUpload);
            System.out.println("The image has been uploaded and is reachable using the URL: " + myImageUrl);
        } catch (IOException e) {
            System.out.println("There was a problem uploading the image.");
            e.printStackTrace();
        }
    }
}

An output of the code above will look like this:

The image has been uploaded and is reachable using the URL:

As you can see in the sample above, your account name and your private posting are required to upload an image - If you do not provide those details, your upload request will not be accepted.

If you have security doupts about it you can:

Contribute

If you want to support the project simply clone the git repository and submit a pull request.

git clone https://github.com/marvin-we/steemj-image-upload.git

Additional Information

You can find additional information and also the source code on GitHub.

https://github.com/marvin-we/steemj-image-upload

Get in touch!

Most of my projects are pretty time consuming and I always try to provide some useful stuff to the community. What keeps me going for that is your feedback and your support. For that reason I would love to get some Feedback from you <3. Just contact me here on Steemit or ping me on GitHub.


If you want to stay up to date or just like the stuff I am doing it would be great if you leave me a like, resteem the post and/or follow me.

Thanks for reading and best regards,
@dez1337



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
25 Comments