Joke Robot makes use of a couple of APIs: JokeAPI (a REST API that serves uniformly formatted jokes) and Text-to-Speech API, which takes the jokes and plays them back in audio format.
(Because "How do you find Will Smith in the snow? You look for the Fresh Prints!" just sounds better out loud than it looks in written text!)
Here's my favourite programming joke from the JokeAPI:
A SQL statement walks into a bar and sees two tables. It approaches, and asks "may I join you?"
~ ba dum tss ~ 🥁
- Set up an account with Text-to-Speech API.
- Copy
config.example.js
toconfig.js
. - Replace the placeholder value in
config.js
with your own API key. - Save the changes and run the application using a local development server such as Live Server.