Public
Daily cron: email a digest of new RSS items via std/email
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.
This val is a daily cron that fetches an RSS feed, finds the items published since its last run, and emails you a digest. The last-run timestamp is stored in blob storage, so you never get the same item twice. If nothing new was published, no email is sent.
- Remix this val.
- In
main.tsx, setFEED_URLto the feed you want (any RSS or Atom feed works). - The cron is scheduled daily at 13:00 UTC (9am Eastern). Adjust the schedule on
main.tsxin the editor if you want a different time — cron expressions run in UTC. - Optional: click Run on
main.tsxto test it immediately. On the first run it looks back 24 hours.
The digest is sent to your Val Town account email via std/email. No API keys or environment variables are needed.
main.tsx— the cron handler: loadlastRunAtfrom blob, fetch new items, send the digest, save the new timestamprss.ts— fetches and parses the feed (rss-parser), filters items newer thansincedigest.tsx— renders the email HTML with Hono JSXemail.ts—std/emailwrapper with a small retry, since sends can fail transiently