gator
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.
feed-generator.ts
https://figleaf--4d7ba546bbb111f093d242dde27851f2.web.val.run
A Val Town-based podcast feed aggregator that combines audio content from multiple sources into a single RSS feed.
- Email Integration: Send emails with audio attachments to add episodes
- RSS Polling: Automatically polls an RSS feed daily for "3-track" posts
- Podcast Feed: Generates a standard podcast RSS feed for all aggregated content
The system consists of 3 Val Town vals:
- Email Handler (
backend/email-handler.ts) - Email trigger - RSS Poller (
backend/rss-poller.ts) - Cron trigger (daily) - Feed Generator (
backend/feed-generator.ts) - HTTP trigger
Deploy each of these files as separate vals on Val Town:
- Deploy
backend/feed-generator.tsas an HTTP val - This will be your main podcast feed URL
- Save the URL - you'll use this in your podcast app
- Deploy
backend/rss-poller.tsas a Cron val - Set schedule to run daily:
0 0 * * *(runs at midnight UTC) - Or use Val Town's UI to set "Once a day"
- Deploy
backend/email-handler.tsas an Email val - Val Town will provide you with a unique email address
- Forward or send emails with audio attachments to this address
Edit backend/rss-poller.ts and update the RSS feed URL if needed:
const RSS_FEED_URL = "https://nnnnnnnn.co/rss.xml";
- Send an email with an audio file (.mp3, .m4a, etc.) to your Val's email address
- Or send an email containing a direct link to an audio file (e.g., https://example.com/audio.mp3)
- Check the Val's logs to confirm it processed successfully
- Run the RSS Poller val manually first to populate initial episodes
- Check the logs to see how many "3-track" posts were found
- Visit your HTTP val URL in a browser
- You should see an XML RSS feed
- Add this URL to your podcast app
Use the HTTP val URL in any podcast player that supports custom RSS feeds:
- Apple Podcasts
- Overcast
- Pocket Casts
- Any other RSS-compatible app
- Receives email at Val Town email address
- Extracts audio attachments (mp3, m4a, wav, ogg, aac, flac)
- Extracts URLs from email body and checks for direct audio links
- Uses email subject as episode title
- Uses email body as episode description
- Stores metadata in SQLite database
- Supports both attached audio files and URLs to audio files
- Runs daily via cron schedule
- Fetches RSS feed from configured URL
- Filters for posts containing "3-track" in title or content
- Extracts full post text as episode description
- Finds mp3 links in enclosures or content
- Tracks processed items to avoid duplicates
- Adds new episodes to database
- HTTP endpoint accessible via web browser or podcast app
- Queries all episodes from database
- Generates standard podcast RSS feed with iTunes tags
- Sorts episodes by publication date (newest first)
- Includes full descriptions from original sources
id: Auto-incrementing primary keysource: "email" or "rss"title: Episode titleaudio_url: URL to audio filepub_date: Publication date (ISO 8601)description: Full episode descriptionguid: Unique identifiercreated_at: When added to database
guid: Unique identifier from RSS feedprocessed_at: When item was processed
- YouTube audio extraction support
- Web interface for managing episodes
- Manual episode upload
- Episode editing/deletion
- Analytics and statistics
- Support for additional RSS feeds
- Check that RSS poller has run at least once
- Verify the RSS feed URL is correct
- Check Val logs for errors
- Confirm email contains audio attachment or URL to audio file
- Check supported audio formats (mp3, m4a, wav, ogg, aac, flac)
- URLs must be direct links ending in audio file extension
- Review email handler logs for URL detection
- Verify HTTP val is public
- Test feed URL in browser first
- Ensure XML is well-formed
- Runtime: Deno (Val Town)
- Database: SQLite (Val Town)
- Language: TypeScript
- RSS Format: RSS 2.0 with iTunes tags