Compare commits
No commits in common. "cdeb91c7d4f90f9b66fe0f46e5a67cfa75f87fac" and "89b51307b3c6183e7b8becd6e0c3ff46b586bce6" have entirely different histories.
cdeb91c7d4
...
89b51307b3
4 changed files with 20 additions and 30 deletions
19
README.md
19
README.md
|
@ -165,22 +165,3 @@ error: false
|
|||
code: "fr"
|
||||
```
|
||||
- View more [examples](https://github.com/ethauvin/jokeapi/blob/master/src/test/kotlin/net/thauvin/erik/jokeapi/ApiCallTest.kt#L48)...
|
||||
|
||||
## Contributing
|
||||
|
||||
If you want to contribute to this project, all you have to do is clone the GitHub
|
||||
repository:
|
||||
|
||||
```console
|
||||
git clone git@github.com:ethauvin/jokeapi.git
|
||||
```
|
||||
|
||||
Then use [bld](https://rife2.com/bld) to build:
|
||||
|
||||
```console
|
||||
cd jokeapi
|
||||
./bld compile
|
||||
```
|
||||
|
||||
The project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all
|
||||
the dependencies were downloaded and peruse the code.
|
||||
|
|
22
pom.xml
22
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.thauvin.erik</groupId>
|
||||
<artifactId>jokeapi</artifactId>
|
||||
<version>0.9.2-SNAPSHOT</version>
|
||||
<version>0.9.1</version>
|
||||
<name>jokeapi</name>
|
||||
<description>Retrieve jokes from Sv443's JokeAPI</description>
|
||||
<url>https://github.com/ethauvin/jokeapi</url>
|
||||
|
@ -18,7 +18,25 @@
|
|||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib</artifactId>
|
||||
<version>1.9.22</version>
|
||||
<version>1.9.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-common</artifactId>
|
||||
<version>1.9.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk7</artifactId>
|
||||
<version>1.9.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>1.9.21</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -45,9 +45,6 @@ import java.util.stream.Collectors
|
|||
object JokeApi {
|
||||
private const val API_URL = "https://v2.jokeapi.dev/"
|
||||
|
||||
/**
|
||||
* The logger instance.
|
||||
*/
|
||||
@JvmStatic
|
||||
val logger: Logger by lazy { Logger.getLogger(JokeApi::class.java.simpleName) }
|
||||
|
||||
|
|
|
@ -123,9 +123,6 @@ private fun httpError(responseCode: Int): HttpErrorException {
|
|||
return httpException
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse Error.
|
||||
*/
|
||||
internal fun parseError(json: JSONObject): JokeException {
|
||||
val causedBy = json.getJSONArray("causedBy")
|
||||
val causes = List<String>(causedBy.length()) { i -> causedBy.getString(i) }
|
||||
|
@ -139,9 +136,6 @@ internal fun parseError(json: JSONObject): JokeException {
|
|||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse Joke.
|
||||
*/
|
||||
internal fun parseJoke(json: JSONObject, splitNewLine: Boolean): Joke {
|
||||
val jokes = mutableListOf<String>()
|
||||
if (json.has("setup")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue