hackernews-frontpage
- 作者仓库星标 0
- 作者更新于 2026年8月24日 23:55
- 作者仓库 gstack
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.
- 流狐分类
- 通用
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 92 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @garrytan · v1.0.0 · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Usage
Navigates to https://news.ycombinator.com via the daemon. Reads the page HTML. Parses each story row (HN's stable tr.athing structure) into a typed
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
# 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
1. Navigates to `https://news.ycombinator.com` via the daemon.
2. Reads the page HTML.
3. Parses each story row (HN's stable `tr.athing` structure) into a typed
`Story` record.
4. 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. 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Usage → How it works → Why this is the reference skill
要点 -> Scrapes the Hacker News (news.ycombinator.com) front page and returns the top 30 stories as JSON. · 1. Navigates to https://news.ycombinator.com via the daemon. · hackernews-frontpage is the smallest interesting browser-skill: no auth, stable HTML, deterministic output, file-fixture-friendly. · When the HN HTML rotates and our selectors break, the test fails against the captured fixture before users notice.
文件/命令 -> news.ycombinator.com · https://news.ycombinator.com · tr.athing · Story · hackernews-frontpage · $B skill run hackernews-frontpage · script.test.ts
内容 SHA-256 -> b59e15f58490
设计思路
hackernews-frontpage不是日常用的「读 HN 工具」,而是 gstack browser-skill 体系的官方参考实现——最小、最稳、最可测的样板:无登录、HTML 结构稳定(HN 的tr.athing)、确定性输出、对 fixture 友好。Phase 1 的每个组件(SDK / scoped token / 三层查找 / spawn 生命周期)都被$B skill run hackernews-frontpage和 bundled 的script.test.ts跑一遍,相当于一份活的烟雾测试。用法
工作机制
https://news.ycombinator.comtr.athing结构解析每行 story 成 typedStory为什么是参考 skill
最小有趣 = 学习 cost 最低,但又把整套 browser-skill 框架的所有关键面都覆盖了。HN 的 HTML 一旦轮换、selector 失效,捕获的 fixture 测试会先于用户报失败——这正是它存在的意义。
适合谁
不适合
配套
browse(执行 verb)、gstack(入口)、webapp-testing(写测试 / fixture)、scrape(更通用的抓取场景)。