Hacker News
2026-03-29
新闻来源:网淘吧
围观:10
电脑广告
手机广告
黑客新闻
用于 Hacker News API 的命令行工具。无需身份验证。
命令行使用
运行scripts/hn.sh <命令>。所有命令都支持--json参数以输出原始 JSON 格式。
浏览故事
# Top/trending stories (default 10)
scripts/hn.sh top
scripts/hn.sh top --limit 20
# Other lists
scripts/hn.sh new --limit 5 # newest
scripts/hn.sh best --limit 10 # highest rated
scripts/hn.sh ask # Ask HN
scripts/hn.sh show # Show HN
scripts/hn.sh jobs # job postings
查看条目详情及评论
# Full item details (story, comment, job, poll)
scripts/hn.sh item 12345678
# Top comments on a story
scripts/hn.sh comments 12345678
scripts/hn.sh comments 12345678 --limit 10 --depth 2
用户资料
scripts/hn.sh user dang
搜索
# Basic search
scripts/hn.sh search "rust programming"
# With filters
scripts/hn.sh search "LLM" --type story --sort date --period week --limit 5
scripts/hn.sh search "hiring remote" --type comment --period month
招聘信息
# Latest "Who is hiring?" job postings
scripts/hn.sh whoishiring
scripts/hn.sh whoishiring --limit 20
常见工作流程
| 用户提问 | 命令 |
|---|---|
| "HN 上有什么热门话题?" | scripts/hn.sh top |
| "最新的 Ask HN 帖子" | scripts/hn.sh ask |
| "在 HN 上搜索 X" | scripts/hn.sh search "X" |
| "显示故事 Y 的评论" | scripts/hn.sh comments Y |
| "谁在招聘?" | scripts/hn.sh whoishiring |
| "告诉我关于HN用户Z的信息" | scripts/hn.sh user Z |
备注
- 故事列表采用并行获取以提高速度
- 评论/简介中的HTML会自动转换为纯文本
- 时间戳显示为相对时间(如"2小时前"、"3天前")
- 有关API详情,请参阅references/api.md
文章底部电脑广告
手机广告位-内容正文底部
上一篇:GitClaw
下一篇:AI News ZH - 中文AI科技日报


微信扫一扫,打赏作者吧~