黑客新闻头版
- 作者仓库星标 0
- 作者更新于 2026年8月24日 15:55
- 作者仓库 gstack
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 92 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @garrytan · v1.0.0 · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# 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.
章节与文件索引
按说明文件中的顺序排列。
它是如何运作的
为什么这是参考技能
文件/命令 -> news.ycombinator.com · https://news.ycombinator.com · tr.athing · Story · hackernews-frontpage · $B skill run hackernews-frontpage · script.test.ts
内容校验值 -> 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(更通用的抓取场景)。