A lighter and simpler Gfycat API wrapper.
It's built for Android, written in Kotlin, using Moshi, Retrofit and OkHttp.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.KirkBushman:gfycat-android:Tag'
}
// 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)
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")
This project is licensed under the MIT License