Receives Twitter/X, Reddit, and LinkedIn-style feed payloads through a webhook, stores normalized feed items in Val-scoped SQLite, then runs a daily AI summarization and email workflow using Val Town's standard OpenAI integration.
webhookIngest.ts accepts POST requests with JSON.
Batch payload shape:
{ "feeds": [ { "platform": "twitter", "fetchedAt": "2026-06-18T16:00:00.000Z", "items": [ { "externalId": "tweet-123", "title": "Short headline", "body": "Full post text or extracted body", "url": "https://example.com/item", "author": "@author", "publishedAt": "2026-06-18T15:30:00.000Z" } ] } ] }
A single feed object with platform and items is also accepted. Supported platforms are twitter, reddit, and linkedin.
Optional security: set WEBHOOK_SECRET. When configured, callers must send either Authorization: Bearer <secret> or x-webhook-secret: <secret>.
Add WEBHOOK_SECRET here: https://www.val.town/x/michaelkronovet_libretto/daily-feed-orchestrator/environment-variables?key=WEBHOOK_SECRET
- AI summaries use
https://esm.town/v/std/openaiwithgpt-4o-mini; noOPENAI_API_KEYis required. - Email delivery uses
https://esm.town/v/std/email. - If
SUMMARY_EMAIL_TOis not set, email is sent to the Val owner by default.
Add SUMMARY_EMAIL_TO here if you want a specific recipient: https://www.val.town/x/michaelkronovet_libretto/daily-feed-orchestrator/environment-variables?key=SUMMARY_EMAIL_TO
summarizeDaily.ts: daily at16:30 UTC
Val Town cron expressions run in UTC.
webhookIngest.ts: public HTTP webhook listener for feed payloads.webhookWorkflow.ts: validates and normalizes webhook payloads, then persists them.summarizeWorkflow.ts: summarizes the latest completed ingest run that has not already been summarized.db.ts: owns the SQLite schema and queries.types.ts: shared TypeScript types.feedClients.tsandingestDaily.ts: mock/reference ingest code, no longer scheduled.
feed_runs: one row per webhook ingest workflow execution.feed_items: normalized feed records keyed by(platform, external_id)for idempotent upserts.feed_summaries: one summary per completed run.