hackernews-frontpage
它能做什么
这项技能读取 Hacker News 首页,并以结构化数据的形式返回排名前 30 的新闻。适合想快速获取其中热门内容清单的人。
适用场景
- ✓你想获取 Hacker News 当前排名靠前的新闻的时候。
- ✓你想获取新闻标题、链接和分数列表的时候。
- ✓你想追踪哪些新闻在 Hacker News 上排名最高的时候。
技能链接
https://github.com/garrytan/gstack/blob/main/browser-skills/hackernews-frontpage/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请告诉我 Hacker News 现在排名前 30 的新闻,以及它们的分数和评论数。”
每周 5 个新技能,1 分钟读完。
工作原理
它打开 Hacker News 首页,读取新闻条目,并把每条新闻的排名、标题、链接、分数和评论整理为一份列表返回。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Hacker News front-page scraper
Scrapes the Hacker News (news.ycombinator.com) front page and returns the
top 30 stories as JSON. Each story has its rank, title, link URL, point count,
and comment count.
Usage
$ $B skill run hackernews-frontpage
{
"stories": [
{ "rank": 1, "title": "...", "url": "...", "points": 412, "comments": 87 },
...
],
"count": 30
}
How it works
- Navigates to
https://news.ycombinator.comvia the daemon. - Reads the page HTML.
- Parses each story row (HN's stable
tr.athingstructure) into a typedStoryrecord. - Emits a single JSON document on stdout.
Why this is the reference skill
hackernews-frontpage is the smallest interesting browser-skill: no auth,
stable HTML, deterministic output, file-fixture-friendly. Every Phase 1
component (SDK, scoped tokens, three-tier lookup, spawn lifecycle) is
exercised by $B skill run hackernews-frontpage and the bundled
script.test.ts.
When the HN HTML rotates and our selectors break, the test fails against the captured fixture before users notice. That's the point.
常见问题
它返回多少条新闻?
描述说明它返回排名前 30 的新闻。
每条新闻包含哪些信息?
排名、标题、链接、分数和评论数。
它需要登录吗?
不需要。技能说明它无需身份验证即可工作。
详情
热度
- GitHub 星标
- 139k
- 排名
- #687
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …