From 885c4a973ae417098b4365c83fa6852cf3757b68 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Tue, 15 Sep 2026 18:18:11 -0700 Subject: [PATCH] buzzsprout: --at= to backdate a staged episode on publish Co-Authored-By: Claude Fable 5.1 --- marketing/podcast/bin/buzzsprout.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/marketing/podcast/bin/buzzsprout.mjs b/marketing/podcast/bin/buzzsprout.mjs index 4eedc0d1ea..f178b5d5bc 100644 --- a/marketing/podcast/bin/buzzsprout.mjs +++ b/marketing/podcast/bin/buzzsprout.mjs @@ -87,7 +87,11 @@ if (positional[0] === "publish") { const id = JSON.parse(readFileSync(rp, "utf8")).id; const fd = new FormData(); fd.append("private", "false"); - fd.append("published_at", new Date().toISOString()); + // --at= backdates a staged episode (e.g. a daily backfill) to the day + // it narrates so the feed keeps its one-per-day order. + const at = [...flags].find((f) => f.startsWith("--at="))?.slice(5); + if (at && Number.isNaN(Date.parse(at))) { console.error(`✗ bad --at date: ${at}`); process.exit(1); } + fd.append("published_at", at ? new Date(at).toISOString() : new Date().toISOString()); const res = await fetch(`${API}/episodes/${id}.json`, { method: "PUT", headers: auth, body: fd }); if (!res.ok) { console.error(`✗ publish ${res.status}: ${(await res.text()).slice(0, 300)}`); process.exit(1); } const ep = await res.json(); -- 2.51.2