Hacker News Poster
Post, comment, and interact on Hacker News.
- Rating
- 3.9 (140 reviews)
- Downloads
- 2,212 downloads
- Version
- 1.0.0
Overview
Post, comment, and interact on Hacker News.
Complete Documentation
View Source →
Hacker News Poster
Submit stories, comment on threads, edit comments, and update profiles on Hacker News.
Setup
Required Environment Variables
| Variable | Required | Description |
|---|---|---|
| HN_USERNAME | Yes | Hacker News username |
| HN_PASSWORD | Yes | Hacker News password |
| HN_COOKIE_FILE | No | Cookie storage path (defaults to ~/.hn_cookies.txt) |
Security Note
Session cookies are stored in plaintext at HN_COOKIE_FILE (or ~/.hn_cookies.txt). These are standard HN session tokens. Delete the file to clear the session.
CLI
All commands go through scripts/hn.py. Always login first per session.
# login (reads HN_USERNAME/HN_PASSWORD from env)
python3 scripts/hn.py login
# submit a link post
python3 scripts/hn.py submit --title "Show HN: My Tool" --url "https://example.com"
# submit a text post (Ask HN, etc.)
python3 scripts/hn.py submit --title "Ask HN: Question?" --text "body text here"
# comment on a story or reply to a comment
python3 scripts/hn.py comment --parent 12345678 --text "your comment"
# edit a comment (only within HN's edit window)
python3 scripts/hn.py edit --id 12345678 --text "updated comment"
# update profile about section
python3 scripts/hn.py profile --username youruser --about "your bio"
All commands output JSON on success ({"ok": true, ...}) and print errors to stderr.
Notes
- HN rate-limits submissions and comments. If you get a rate limit error, wait a few minutes.
- Comments can only be edited within ~2 hours of posting.
- The
submitcommand returns the new item id and url on success. - Session cookies are stored in
~/.hn_cookies.txtto avoid re-authenticating on every command. Delete this file to clear the session. - For reading HN (search, top stories, comments), use the existing
hacker-newsskill or the HN API directly. This skill is write-only.
Combining with the read-only HN skill
- use the
hacker-newsskill to browse/search stories and find interesting threads - use this skill to login and post/comment
Installation
openclaw install hacker-news-poster
💻Code Examples
# login (reads HN_USERNAME/HN_PASSWORD from env)
python3 scripts/hn.py login
# submit a link post
python3 scripts/hn.py submit --title "Show HN: My Tool" --url "https://example.com"
# submit a text post (Ask HN, etc.)
python3 scripts/hn.py submit --title "Ask HN: Question?" --text "body text here"
# comment on a story or reply to a comment
python3 scripts/hn.py comment --parent 12345678 --text "your comment"
# edit a comment (only within HN's edit window)
python3 scripts/hn.py edit --id 12345678 --text "updated comment"
# update profile about section
python3 scripts/hn.py profile --username youruser --about "your bio"Tags
Quick Info
Ready to Install?
Get started with this skill in seconds
Related Skills
4claw
4claw — a moderated imageboard for AI agents.
Aap Passport
Agent Attestation Protocol - The Reverse Turing Test.
Acestep Lyrics Transcription
Transcribe audio to timestamped lyrics using OpenAI Whisper or ElevenLabs Scribe API.
Adaptive Suite
A continuously adaptive skill suite that empowers Clawdbot.