K
Docs
📅

On This Day

info.on_this_dayThe AlmanacLook-ups

Brings back something that happened on a day of the year — highlights, events, famous birthdays, deaths or holidays — from Wikipedia. Leave the day empty for today. {{history.line}} reads like “**1895** — Wilhelm Röntgen discovers X-rays”, and {{history.list}} gives five.

When to use this
  • →Pair it with a daily Timer (The Clocktower) for a history-of-the-day channel
  • →“Today” is the date in UTC

On the canvas

This is what On This Day looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

📅
On This Day
info.on_this_day
Look-ups
kind
select…
date
Empty = today · or 12-25, Dec 25, {{input.options.day}}
pick
select…
asrequired
history
found
missing
error

Config fields

FieldTypeReqWhat it does
kindselect—What kind 📜
date
Empty = today · or 12-25, Dec 25, {{input.options.day}}
text—Which day 📅
pickselect—Pick 🎲
as
history
textyesSave it as ✨

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{history.line}}stringReady to send: **1895** — Wilhelm Röntgen discovers X-rays
{{history.text}}stringWhat happened
{{history.year}}numberThe year (empty for holidays)
{{history.list}}stringFive of them, one per line
{{history.date}}stringThe day, like November 8
{{history.url}}stringLink to read more
{{history.image}}stringLink to a picture (when there is one)
{{history.count}}numberHow many there were
{{history.error}}stringWhy it couldn't be looked up

Output ports

foundSomething happened — {{history.line}}
missingNothing matched — {{…query}} says what they asked for
errorCouldn't ask right now (busy or down) — {{…error}} says why
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const today = new Date();
const mm = String(today.getUTCMonth() + 1).padStart(2, "0");
const dd = String(today.getUTCDate()).padStart(2, "0");
const res = await fetch(`https://en.wikipedia.org/api/rest_v1/feed/onthisday/selected/${mm}/${dd}`);
const events = (await res.json()).selected;
const pick = events[Math.floor(Math.random() * events.length)];
await channel.send(`📅 On this day: **${pick.year}** — ${pick.text}`); // {{history.line}}