A simple Kotlin/Java library to retrieve jokes from Sv443's JokeAPI. https://github.com/ethauvin/jokeapi
Find a file
2022-09-21 23:35:02 -07:00
.idea Started README 2022-09-21 23:35:02 -07:00
gradle/wrapper Initial commit. 2022-09-21 02:50:11 -07:00
src Added splitNewLine parameter 2022-09-21 23:34:43 -07:00
.editorconfig Initial commit. 2022-09-21 02:50:11 -07:00
.gitattributes Initial commit. 2022-09-21 02:50:11 -07:00
.gitignore Initial commit. 2022-09-21 02:50:11 -07:00
build.gradle.kts Cleaned up tests 2022-09-21 22:34:57 -07:00
detekt-baseline.xml Initial commit. 2022-09-21 02:50:11 -07:00
gradlew Initial commit. 2022-09-21 02:50:11 -07:00
gradlew.bat Initial commit. 2022-09-21 02:50:11 -07:00
LICENSE.txt Initial commit. 2022-09-21 02:50:11 -07:00
README.md Started README 2022-09-21 23:35:02 -07:00
settings.gradle.kts Initial commit. 2022-09-21 02:50:11 -07:00

JokeAPI for Kotlin/Java

A simple Kotlin/Java library to retrieve jokes from Sv443's JokeAPI.

Examples (TL;DR)

import net.thauvin.erik.jokeapi.JokeApi.Companion.getJoke

val joke = getJoke()
val safe = getJoke(safe = true)
val pun = getJoke(category = Category.PUN)

A Joke class instance is returned:

data class Joke(
    val error: Boolean,
    val category: Category,
    val type: Type,
    val joke: Set<String>,
    val flags: Set<Flag>,
    val id: Int,
    val safe: Boolean,
    val language: Language
)