Readme

Daily Dad Joke

How do you make a programmer laugh every morning?

A dad joke cron job!

Setup

  1. Fork this val
  2. Click Create fork
  3. 🤣🤣🤣🤣

API

This val uses the icanhazdadjoke API. You can find more docs here, such as how to filter by type.

1
2
3
4
5
6
7
8
9
10
import { email } from "https://esm.town/v/std/email";
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export async function dailyDadJoke() {
let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
return email({
text: punchline,
subject: setup,
});
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
2
nbbaier avatar

Is there a way to limit it to type: programming

stevekrouse avatar

Yes! https://official-joke-api.appspot.com/jokes/programming/random

Just added a comment about that to the docs.

v18
December 12, 2023