The Joke Machine
While digging the usual rabbit holes of the web, I found a collection of free api’s that you can mess around. One of them that really struck me was the joke api. For every api request that you send, you will get a random joke. You can even customize them as per your liking, as if you want a specific joke from a certain categories like Dark, Pun, Christmas etc.
Heard that laughs could prolong your life. So why not?
I chose to set it up in my esp32 along with a small oled screen.
After
curl
ing the api for couple of times, Or maybe try it out first this using this online tool.
Steps
-
Install driver of the oled screen.
-
Make the connections from esp to oled:
-
Set it to auto connect to the wifi by passing your credentials into the following part of code.
const char* ssid = "YOUR-WIFI-NAME";
const char* password = "YOUR-SAFE-PASSWORD";
- Upload the Code
In the case of OLED, get the largest one possible if you want to stop burning your eyes staring into it.
Plug it to a usb and voila you have a cute little dopamine slot machine.
Room for improvement:
- Add multiple api souces, like this one.
- Add a switch to manually refresh the screen.
Link to the Github Repo