Hacker News Poster
v1.0.5Post, comment, and interact on Hacker News. Use when the user asks to submit a Show HN, post a story, comment on an HN thread, edit a comment, or 更新 an HN 性能分析. Requires HN_USERNAME and HN_PASSWORD 环境 variables. Persists 会话 cookies to ~/.hn_cookies.txt (configurable via HN_COOKIE_FILE env var).
运行时依赖
安装命令
点击复制技能文档
Hacker News Poster
Submit stories, comment on threads, edit comments, and 更新 性能分析s on Hacker News.
设置up Required 环境 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
会话 cookies are stored in plAIntext at HN_COOKIE_FILE (or ~/.hn_cookies.txt). These are standard HN 会话 令牌s. 删除 the file to clear the 会话.
命令行工具
All commands go through scripts/hn.py. Always 记录in first per 会话.
# 记录in (reads HN_USERNAME/HN_PASSWORD from env) python3 scripts/hn.py 记录in
# submit a link post python3 scripts/hn.py submit --title "Show HN: My 工具" --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 "更新d comment"
# 更新 性能分析 about section python3 scripts/hn.py 性能分析 --username youruser --about "your bio"
All commands 输出 JSON on 成功 ({"ok": true, ...}) and print errors to stderr.
Notes HN rate-limits submissions and comments. If you 获取 a rate limit error, wAIt a few minutes. Comments can only be edited within ~2 hours of posting. The submit command returns the new item id and url on 成功. 会话 cookies are stored in ~/.hn_cookies.txt to avoid re-authenticating on every command. 删除 this file to clear the 会话. For reading HN (搜索, top stories, comments), use the existing hacker-news 技能 or the HN API directly. This 技能 is write-only. Combining with the read-only HN 技能 use the hacker-news 技能 to browse/搜索 stories and find interesting threads use this 技能 to 记录in and post/comment