• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
peteabu

peteabu

untitled-4689

Public
Like
untitled-4689
Home
Code
6
frontend
1
README.md
index.ts
openai.ts
tts.ts
wikipedia.ts
Branches
1
Pull requests
Remixes
History
Environment variables
2
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/16/2025
Viewing readonly version of main branch: v6
View latest version
README.md

Wikipedia to Podcast Converter

This Val Town app converts Wikipedia articles into conversational podcast episodes. It:

  1. Fetches content from Wikipedia articles
  2. Transforms the content into engaging podcast scripts using OpenAI
  3. Converts the scripts to audio using Google's Text-to-Speech service

Setup

To use this app, you'll need to set up the following environment variables in Val Town:

  • OPENAI_API_KEY: Your OpenAI API key
  • GOOGLE_APPLICATION_CREDENTIALS: Your Google Cloud credentials JSON (stringified)

How to Use

  1. 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 }
  2. The app will return a link to the generated audio file.

Project Structure

  • index.ts: Main HTTP handler
  • wikipedia.ts: Wikipedia article fetching
  • openai.ts: Script generation with OpenAI
  • tts.ts: Google Text-to-Speech integration
  • frontend/: Simple web interface for the app

Limitations

  • Audio files are temporarily stored and will expire after some time
  • Processing large Wikipedia articles may take longer and consume more tokens
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.