From 076bb635475404805c79417317e18f0c0b4d5ef5 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 18 Jul 2026 11:47:07 -0700 Subject: [PATCH] Fix hosted essay links in podcast notes --- marketing/podcast/bin/buzzsprout.mjs | 29 ++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/marketing/podcast/bin/buzzsprout.mjs b/marketing/podcast/bin/buzzsprout.mjs index aa203f1ba7..4fbc36649b 100644 --- a/marketing/podcast/bin/buzzsprout.mjs +++ b/marketing/podcast/bin/buzzsprout.mjs @@ -22,6 +22,7 @@ import { readFileSync, writeFileSync, existsSync } from "node:fs"; import { resolve, dirname, basename } from "node:path"; import { fileURLToPath } from "node:url"; +import { hosted } from "../lib/hosted.mjs"; const HERE = dirname(fileURLToPath(import.meta.url)); const ROOT = resolve(HERE, ".."); @@ -60,6 +61,13 @@ const argv = process.argv.slice(2); const flags = new Set(argv.filter((a) => a.startsWith("--"))); const positional = argv.filter((a) => !a.startsWith("--")); +const episodeDescription = (slug, meta = {}) => { + const title = meta.title || slug; + const siteName = hosted(slug) || `aesthetic-${slug}-essay`; + const essayUrl = `https://papers.aesthetic.computer/${siteName}.pdf`; + return `${meta.description || `A reading of "${title}" in @jeffrey's voice.`}\n\nWrite with questions and feedback: mail@aesthetic.computer. Unless you ask us not to, your letter may be read or mentioned on a future episode.\n\nRead the essay: ${essayUrl}\nMore readings + papers: https://papers.aesthetic.computer`; +}; + // ── list ─────────────────────────────────────────────────────────────── if (positional[0] === "list") { const res = await fetch(`${API}/episodes.json`, { headers: auth }); @@ -87,6 +95,24 @@ if (positional[0] === "publish") { process.exit(0); } +// Refresh the show notes of an existing episode without replacing its audio. +if (positional[0] === "description") { + const s = positional[1]; + const rp = resolve(OUT, `${s}.buzzsprout.json`); + const mp = resolve(OUT, `${s}.json`); + if (!existsSync(rp)) { console.error(`✗ no receipt ${rp}`); process.exit(1); } + const receipt = JSON.parse(readFileSync(rp, "utf8")); + const meta = existsSync(mp) ? JSON.parse(readFileSync(mp, "utf8")) : {}; + const fd = new FormData(); + fd.append("description", episodeDescription(s, meta)); + const res = await fetch(`${API}/episodes/${receipt.id}.json`, { method: "PUT", headers: auth, body: fd }); + if (!res.ok) { console.error(`✗ description ${res.status}: ${(await res.text()).slice(0, 300)}`); process.exit(1); } + const ep = await res.json(); + writeFileSync(rp, JSON.stringify(ep, null, 2) + "\n"); + console.log(`✓ ${s} description refreshed`); + process.exit(0); +} + // ── set an episode's artwork ─────────────────────────────────────────── // Push out/-cover-1400.png (Buzzsprout wants a square 1400–3000px // image) to the live episode. Buzzsprout ingests it async: the PUT returns a @@ -148,8 +174,7 @@ if (existsSync(receiptPath) && !flags.has("--force")) { } const title = meta.title || slug; -const essayUrl = `https://papers.aesthetic.computer/aesthetic-${slug}-essay.pdf`; -const description = `${meta.description || `A reading of "${title}" in @jeffrey's voice.`}\n\nWrite with questions and feedback: mail@aesthetic.computer. Unless you ask us not to, your letter may be read or mentioned on a future episode.\n\nRead the essay: ${essayUrl}\nMore readings + papers: https://papers.aesthetic.computer`; +const description = episodeDescription(slug, meta); const fd = new FormData(); fd.append("title", title); -- 2.51.2