Taneda Santōka

Santōka Every Hour

A microblog bot that posts a random haiku by Santōka Taneda every hour.

Credits

Tech

Live at

The Algo

I'm aiming at a good enough deterministic random poem every hour. Here's how it works:

  1. Grab a seeded Knuth shuffle of all the poems where the seed is hours since epoch / number of poems. This gives us the current cycle index.
  2. Grab the nth poem, where n is the current hour since the beginning of cycle.
  3. Post to Bluesky, Mastodon, and Twitter when /haiku is called from an authenticated cron job

At the moment, there are enough poems to go about 27 days without any repeats. Since it's based off of a timestamp, it's also statess, so the order is preserved between deployments, between restarts, etc etc.

Dev

  1. Create a .env (see .env.example)
  2. Install deps
    bun install # Or whatever package manager you use
  3. Run the dev server
    bun run dev
  4. Go to http://localhost:5173/haiku to get your haiku for the hour! ✨

Ideas/variations for the future

Buy me a coff- uhhh serverless function

Cron jobs cost money. Not a lot, but some. If you like this bot and want me to make more, consider dropping a tip to help keep it (and sites like my portfolio, which helps me land gigs that buy me food and such) running.

Any donations that exceed the price of Vercel Pro will probably go to the Trevor Project or Mermaids or something. Idk. Drop me a line if you have a suggestion.