How I automate my Substack newsletter with content from my blog

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Very little changes for anyone else; it is one developer documenting a personal, duct-taped blog-to-newsletter pipeline he has run since 2023.

Read this as

Technology writer Simon Willison published a video showing how he builds his email newsletter automatically from his blog. A web-based notebook called Observable pulls recent posts from his blog's database, formats them as a ready-to-paste email, and filters out items already sent. He copies the result into Substack, a newsletter platform, makes small edits, and sends it in a few minutes.

Willison demonstrates a near-free, mostly manual automation: content flows from his Django/Heroku/PostgreSQL blog through GitHub Actions to SQLite served by Datasette on Fly.io, then an Observable notebook renders it as rich text for Substack. The glue is 143 lines of SQL that build HTML via string concatenation, deliberately crude but maintained for fun. The takeaway for decision-makers is that small-scale newsletter automation needs minutes of human editing, not a product.

An Observable notebook fetches JSON from Willison's public Datasette instance using a 143-line SQL query with UNION ALL over blog_entry, blog_blogmark, blog_quotation, blog_note and TIL tables, generating HTML, including three-letter month URL slugs, via SQLite string concatenation and correlated subqueries for tags. The notebook filters previously sent items and exposes a 'copy rich text to clipboard' button; he manually fixes Substack's YouTube auto-embeds and stray blank lines before sending.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Substack Observable Datasette SQLite Fly.io GitHub Actions Heroku

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading

datasette-charts 0.5a0

Datasette Charts 0.5a0 adds calendar heatmaps, box plots and active-over-time charts, enabling richer data visualisation directly in the browser without extra libraries.