Daily Val Digest

Sends a daily Discord digest of new public vals. It grabs previews of READMEs when it exists. When there's no README, it sends the code to GPT-4o for a summary.

Files

  • main.tsx - Main cron function and Discord webhook
  • fetch-vals.ts - Fetches and filters new vals using Val Town SDK
  • ai-summarizer.ts - Generates OpenAI summaries for vals without READMEs

Additional logic

  • Filter out vals that start with untitled- (auto-generated names), blank vals with no files, or vals with an empty main.tsx
  • Skip READMEs that only contains a single header (e.g., "# My Val" with nothing else)
  • Filter out commonly remixed utility vals like Blob Admin, SQLiteExplorer
  • Skip shallow remixes (forks with ≤3 versions)
  • Prioritize main.tsx files for AI summaries and limit code sent to OpenAI to 5KB to avoid token limits

Setup

  1. Set DISCORD_WEBHOOK environment variable
  2. Set OPENAI_API_KEY environment variable
  3. Set testMode = false in main.tsx for production