From 81466378087c9db7d03f35d6109e3c2bde732fb2 Mon Sep 17 00:00:00 2001 From: Pascal Date: Thu, 1 Apr 2021 02:31:55 +0200 Subject: [PATCH 1/3] Update base URL; Update config --- MMM-JokeAPI.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MMM-JokeAPI.js b/MMM-JokeAPI.js index a374224..0f5a6c1 100644 --- a/MMM-JokeAPI.js +++ b/MMM-JokeAPI.js @@ -1,6 +1,8 @@ Module.register("MMM-JokeAPI", { defaults: { - category: "Programming", + lang: "en", + category: "Any", + blacklistFlags: "", fetchInterval: 10 * 1000 }, getStyles() { @@ -48,7 +50,7 @@ Module.register("MMM-JokeAPI", { } }, getJoke() { - fetch(`https://sv443.net/jokeapi/v2/joke/${this.config.category}`).then((response) => { + fetch(`https://v2.jokeapi.dev/joke/${this.config.category}?lang=${this.config.lang}&blacklistFlags=${this.config.blacklistFlags}`).then((response) => { response.json().then((joke) => { this.joke = joke; this.updateDom(); From 000afcdc1a5527ed4561c7b749696da978afe5d4 Mon Sep 17 00:00:00 2001 From: Pascal Date: Thu, 1 Apr 2021 02:33:08 +0200 Subject: [PATCH 2/3] Update README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fdff507..338cd36 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,9 @@ This is a module for `MagicMirror²`; the purpose of the module is to show you j module: 'MMM-JokeAPI', position: 'middle_center', config: { - category: "Programming" + lang: "de", + category: "Programming,Miscellaneous", + blacklistFlags: "nsfw" } } ``` From 5a4fae40a7d632bc13fc0439c7f419ba8b280007 Mon Sep 17 00:00:00 2001 From: Pascal Date: Thu, 1 Apr 2021 02:33:40 +0200 Subject: [PATCH 3/3] Update Readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 338cd36..4fdfb43 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ This is a module for `MagicMirror²`; the purpose of the module is to show you j 1. Clone this repository into your MagicMirror `modules` folder. 2. Edit your configuration file under `config/config.js` with the following configuration. ``` +// https://jokeapi.dev { module: 'MMM-JokeAPI', position: 'middle_center',