
Public
Likeform-to-substack
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v2View latest version
Automatically detects new Google Form submissions (via a linked Google Sheet), generates a blog post with AI, and pushes it to Substack as a draft.
Rendering mermaid diagram...
- Poll Google Sheet — An interval val runs on a schedule (e.g. every 15 min). It fetches all rows from the unlisted Google Sheet via the public CSV/JSON export URL (no API key needed for unlisted sheets).
- Deduplicate — Each row's timestamp (or row number) is tracked in SQLite so we never process the same submission twice.
- Generate Blog Post — New submissions are sent to OpenAI (via Val Town's
std/openai) to generate a full blog post (title + HTML body). - Push to Substack — The generated post is created as a draft on Substack via its internal API (
POST /api/v1/post/), authenticated with yoursubstack.sidcookie. - Log & Review — You review and publish drafts in Substack's UI.
| Key | Description | How to get it |
|---|---|---|
GOOGLE_SHEET_ID | The ID from your Google Sheet URL (between /d/ and /edit) | Copy from the sheet URL |
SUBSTACK_SID | Your substack.sid cookie value | Browser DevTools → Application → Cookies → substack.com → substack.sid |
SUBSTACK_PUB_URL | Your publication subdomain, e.g. yourname.substack.com | Your Substack URL |
Val Town's standard OpenAI is used for inference (no separate API key needed on Pro).
README.md— This filetest-google-sheet.ts— Script to test Google Sheet connectivitytest-substack.ts— Script to test Substack API connectivitymain.ts— (TODO) The main interval cron that ties it all together
- Project plan
- Test Google Sheet connection
- Test Substack connection
- AI blog post generation
- Main pipeline cron
- Dashboard (optional)