/Imgur-Kotlin-SDK

An simple Kotlin SDK for Imgur API

Primary LanguageKotlin

logo

A SIMPLE unofficial SDK for Imgur written in Kotlin.

❔ How to use?

Choose above what dependency manager you'd like to use and follow the steps.

Maven

<repositories>
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
</repositories>
<dependency>
  <groupId>com.github.ianguuima</groupId>
  <artifactId>Imgur-Kotlin-SDK</artifactId>
  <version>e313fae670</version>
</dependency>

Gradle

repositories {
  ...
  maven { url 'https://jitpack.io' }
}
dependencies {
  implementation 'com.github.ianguuima:Imgur-Kotlin-SDK:e313fae670'
}

🤔 Using the SDK

Get your clientId. It's important to proceed and use the methods.

val imgur = Imgur(
  clientId = clientId
)

🌆 Uploading a new image

More easy than this? Impossible!

val uploadResponse = imgur.upload(
  file = file
)

The response will return what you need, such link and image hash.

✖ Deleting a image

val isDeleted = imgur.delete(
  deleteHash = deleteHash
)

You can get the deleteHash from the uploadResponse and isDeleted will return whether the image is deleted or not.

🌟 That's all

I made this SDK to be simple. Pull requests are welcome. Consider leaving a star if this repo helped you.