-
Upon clicking on the button, GET request is sent to the Joke API which return a JSON file.
-
Joke from JSON is sent via the POST request to the Voice RSS Text-To-Speech API which returns an audio response.
-
The audio response is then sent to the hidden audio tag and the audio is played.
You can check out the live preview here: Preview
-
Go to the documentation page for the Voice RSS Text to Speech API page found here
-
Click on 'Get API Key' on the left nav bar.
-
Create a free account.
-
When your account is created, you need to activate the account by clicking the 'Activate Account' button on the sign up page.
-
Once your account is activated, you can copy your API key and paste it into the script.js file.
-
Line 12, replace the api key given under 'key' section with your API key contained in single quotes.