A simple bash script that scrapes Hacker News and opens all the front page stories in your default browser.
- 🧡 Scrapes the Hacker News front page for story links
- 🌐 Opens all stories in your default browser with one command
- 🖥️ Cross-platform support (macOS, Linux, Windows)
- 📊 Shows you exactly which stories will be opened before proceeding
- ⚡ Built-in rate limiting to avoid overwhelming your browser
-
Make the script executable:
chmod +x hanopener.sh
-
Run the script:
./hanopener.sh
-
The script will:
- Fetch the current stories from Hacker News
- Display a numbered list of all stories found
- Ask for confirmation before opening them
- Open each story in your default browser with a small delay
🧡 Hacker News Story Opener (Bash Version)
==========================================
Fetching stories from news.ycombinator.com...
Found 30 stories!
Stories to open:
1. https://example.com/story1
2. https://example.com/story2
...
Open all 30 stories in your browser? (y/N): y
Opening stories...
Opening 1/30: https://example.com/story1
Opening 2/30: https://example.com/story2
...
✅ Successfully opened 30/30 stories!
curl- for fetching web pagesgrep- for text processingsed- for text manipulation- A system command to open URLs:
- macOS:
open(built-in) - Linux:
xdg-open(usually pre-installed) - Windows:
start(built-in)
- macOS:
- ✅ macOS: Uses the
opencommand - ✅ Linux: Uses
xdg-opencommand - ✅ Windows: Uses
startcommand ⚠️ Other systems: Will display URLs for manual copying
- Fetches HTML: Downloads the Hacker News front page using
curl - Extracts URLs: Uses
grepandsedto find all story links withclass="storylink" - Processes URLs: Converts relative URLs to absolute URLs
- User Confirmation: Shows all stories and asks for permission
- Opens Stories: Uses the appropriate system command to open each URL
This project was built using:
- Amazon Q - AI assistant for development
- Claude - AI assistant for code generation and debugging
- Container Use by Dagger - Development environment management
This project is licensed under the MIT License - see the LICENSE file for details.
This script is for educational and personal use. Please be respectful of Hacker News and don't abuse their servers with excessive requests.