A TypeScript application that converts top Hacker News stories into podcast audio using AI. Works with any OpenAI-compatible API.
Inspired by Hacker News Recap by Wondercraft.ai, this tool fetches top stories from Hacker News, summarizes them using AI language models, generates a conversational podcast script, and converts it to audio.
The project works with any OpenAI-compatible API provider. You can use OpenAI's models, xAI's Grok models, or any other compatible service. Simply configure the base URL and model names - no code changes needed.
- April 14, 2025 Podcast (Transcript)
- March 25, 2025 Podcast (Transcript)
- November 7, 2023 Podcast (Transcript)
- Fetches top stories from Hacker News
- Generates summaries and talking points using AI
- Creates conversational podcast scripts
- Iteratively refines scripts for clarity
- Converts scripts to MP3 audio
- Saves transcripts and audio to the output directory
git clone https://github.com/amscotti/hn-podcaster.git
cd hn-podcasterInstall Deno if you haven't already:
curl -fsSL https://deno.land/x/install/install.sh | shOr use mise which will automatically use the version
specified in mise.toml:
mise installCreate a .env file in the project root. The example below uses xAI's Grok
models for text generation and OpenAI for text-to-speech:
# General AI (for summaries and script generation)
GENERAL_AI_API_KEY=your_api_key
GENERAL_AI_BASE_URL=https://api.x.ai/v1
GENERAL_AI_MODEL_SUMMARY=grok-4-fast-non-reasoning
GENERAL_AI_MODEL_MAIN=grok-4-fast
# Text-to-Speech
OPENAI_API_KEY=your_openai_key
OPENAI_TTS_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL_TTS=gpt-4o-mini-ttsUsing other providers: Any OpenAI-compatible API works. Just set the
GENERAL_AI_BASE_URL to your provider's endpoint and use their model names. For
example, to use OpenAI for everything, set
GENERAL_AI_BASE_URL=https://api.openai.com/v1 and use model names like
gpt-4o or gpt-4o-mini.
Generate a podcast:
deno task startOutput files are saved to the output/ directory.
Type checking, linting, and formatting:
deno task checkRun tests:
deno task testsrc/- Core application codeservices/- Service layer with interfaces and implementationsworkflows/- High-level workflow orchestrationshared/- Shared utilities (errors, logging)
app.ts- Main entry pointoutput/- Generated podcasts and transcriptsexample/- Example outputs
The project uses a service-based architecture with dependency injection. AI providers are abstracted behind interfaces, so you can use any OpenAI-compatible API (OpenAI, xAI, locally hosted models, etc.) by just changing the configuration - no code changes required.
Core components:
- HackerNews.ts - Fetches stories from the Hacker News API
- PodcastCreator.ts - Orchestrates summarization and script generation
- PodcastRecorder.ts - Converts scripts to audio
- workflows/ - Coordinates the full pipeline with error handling
- Deno 2.5+
- API key for any OpenAI-compatible provider (OpenAI, xAI, etc.)
