Public
Like
1
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: v118View 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- [test]
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 empty
main.tsx
- Skip READMEs that only contains a single header (e.g., "# My Project" 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.tsx
files 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_WEBHOOK
environment variable - Set
OPENAI_API_KEY
environment variable - Set
testMode = false
in main.tsx for production