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

  1. Install driver of the oled screen.

  2. Make the connections from esp to oled:

    Connection diagram

  3. 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";
  1. 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:

  1. Add multiple api souces, like this one.
  2. Add a switch to manually refresh the screen.

Link to the Github Repo