名称: hackernews
描述: 浏览与搜索 Hacker News。获取热门、最新、最佳、Ask HN、Show HN 故事及招聘信息。查看条目详情、评论和用户资料。通过 Algolia 搜索故事与评论。查找“Who is hiring?”主题帖。适用于任何与 HN 相关的查询,例如“HN 上有什么趋势?”、“在 HN 搜索 AI”、“显示故事 X 的评论”、“谁在招聘?”、“最新的 Ask HN 帖子”。
Hacker News API 的 CLI 工具。无需身份验证。
运行 scripts/hn.sh <命令>。所有命令均支持 --json 参数以输出原始 JSON 格式。
# 热门/趋势故事(默认 10 条)
scripts/hn.sh top
scripts/hn.sh top --limit 20
# 其他列表
scripts/hn.sh new --limit 5 # 最新
scripts/hn.sh best --limit 10 # 评分最高
scripts/hn.sh ask # Ask HN
scripts/hn.sh show # Show HN
scripts/hn.sh jobs # 招聘信息
# 完整条目详情(故事、评论、招聘、投票)
scripts/hn.sh item 12345678
# 故事的热门评论
scripts/hn.sh comments 12345678
scripts/hn.sh comments 12345678 --limit 10 --depth 2
scripts/hn.sh user dang
# 基础搜索
scripts/hn.sh search "rust programming"
# 带过滤条件的搜索
scripts/hn.sh search "LLM" --type story --sort date --period week --limit 5
scripts/hn.sh search "hiring remote" --type comment --period month
# 最新的“Who is hiring?”招聘帖子
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 |