Skip to content

Instantly share code, notes, and snippets.

@dinnouti
Created May 26, 2026 20:23
Show Gist options
  • Select an option

  • Save dinnouti/bfc50f928496034a280a04ca62359d45 to your computer and use it in GitHub Desktop.

Select an option

Save dinnouti/bfc50f928496034a280a04ca62359d45 to your computer and use it in GitHub Desktop.
Get a joke in bash
#!/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