Public
Like
untitled-4689
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: v2View latest version
This Val Town app converts Wikipedia articles into conversational podcast episodes. It:
- Fetches content from Wikipedia articles
- Transforms the content into engaging podcast scripts using OpenAI
- Converts the scripts to audio using Google's Text-to-Speech service
To use this app, you'll need to set up the following environment variables in Val Town:
OPENAI_API_KEY
: Your OpenAI API keyGOOGLE_APPLICATION_CREDENTIALS
: Your Google Cloud credentials JSON (stringified)
-
Make a POST request to the HTTP endpoint with a JSON body containing:
{ "article": "Article_Title_Or_URL", "voices": ["en-US-Neural2-F", "en-US-Neural2-D"] // Optional: Specify Google TTS voices } -
The app will return a link to the generated audio file.
index.ts
: Main HTTP handlerwikipedia.ts
: Wikipedia article fetchingopenai.ts
: Script generation with OpenAItts.ts
: Google Text-to-Speech integrationfrontend/
: Simple web interface for the app
- Audio files are temporarily stored and will expire after some time
- Processing large Wikipedia articles may take longer and consume more tokens