Public
Like
2
new-val-notifications
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: v133View latest version
Sends a daily Discord digest of new public vals from Val Town. It grabs previews of READMEs when it exists. When there's no README, it will send the code to GPT-4o for a summary.
main.tsx- Main cron function and Discord webhookfetch-vals.ts- Fetches and filters new vals using Val Town SDKdatabase.ts- DB queriesai-summarizer.ts- Generates OpenAI summaries for vals without READMEs- [optional]
scratch.ts- Just for clearing SQLite DB during testing
- Filter out vals that start with
untitled-(auto-generated names), blank vals with no files, or vals with an emptymain.tsx - Skip READMEs that only contains a single header (e.g., "# My Val" with nothing else)
- Filter out commonly remixed val names like Blob Admin, SQLiteExplorer since we don't have a public API to check shallow remixes (remixes with few version edits).
- Prioritize
main.tsxfiles for AI summaries and limit code sent to OpenAI to 5KB to avoid token limits (and $$ cost) - Store hashes of READMEs in a SQLite DB to avoid getting notified about repeat vals - again, because we don't have a public API to check if it's a shallow remix yet.
- Set
DISCORD_WEBHOOKenvironment variable - Set
OPENAI_API_KEYenvironment variable - Set
testMode = falsein main.tsx for production