Created
May 26, 2026 20:23
-
-
Save dinnouti/bfc50f928496034a280a04ca62359d45 to your computer and use it in GitHub Desktop.
Get a joke in bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| getAJoke() { | |
| JOKES=$(curl -s --max-time 2 "https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&format=txt&type=single" || true) | |
| if [ "$JOKES" != "" ]; then | |
| echo -e " - Until then, here's a joke for you:\n" | |
| echo -e "$JOKES\n" | |
| fi | |
| } | |
| getAJoke | |
| # from: https://coolify.io/docs/get-started/installation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment