Skip to content

A very lightweight Gfycat API client for Android, built using Moshi and Retrofit

License

Notifications You must be signed in to change notification settings

KirkBushman/gfycat-android

Repository files navigation

gfycat-android

A lighter and simpler Gfycat API wrapper.

It's built for Android, written in Kotlin, using Moshi, Retrofit and OkHttp.

How to install.

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.KirkBushman:gfycat-android:Tag'
}

Obtain a client.


// Userless Grant:
val creds = ClientCredentials(**Client Id**, **Client Secret**)

// or

// Password Grant:
val creds = PasswordCredentials(**Client Id**, **Client Secret**, **Username**, **Password**)

// now let's use them to authenticate

val auth = AuthManager(creds, LOGGING)

val bearer = auth.getAuthToken(SharedPrefsStorageManager(context))
val client = auth.getGfycatClient(bearer)

Use it to browse Gfycat.

val gfycat = client.gfycatFromUrl(uri)
println(gfycat.mp4Url)

val gfycat = client.gfycat(id)
println(gfycat.mp4Url)

val user = client.user(username)
println(gfycat.username + " has " + gfycat.followers + " followers")

License

This project is licensed under the MIT License

About

A very lightweight Gfycat API client for Android, built using Moshi and Retrofit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages