From 5ac9e751c383bac041b59d20825058f3e1128fec Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 21 Sep 2022 23:35:02 -0700 Subject: [PATCH] Started README --- .idea/vcs.xml | 6 ++++++ README.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .idea/vcs.xml create mode 100644 README.md diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9098a4d --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# JokeAPI for Kotlin/Java + +A simple Kotlin/Java library to retrieve jokes from [Sv443's JokeAPI](https://v2.jokeapi.dev/). + +## Examples (TL;DR) + +```kotlin +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: + +```kotlin +data class Joke( + val error: Boolean, + val category: Category, + val type: Type, + val joke: Set, + val flags: Set, + val id: Int, + val safe: Boolean, + val language: Language +) +```