用途:通过 Hacker News 官方 Firebase API 拉取故事、评论、职位与用户数据。主要能力:可获取 topstories、beststories、newstories、askstories、showstories、jobstories 六类故事列表(topstories 与 newstories 各 500 条),按 ID 获取单个条目详情(type 含 story、comment、job、poll、pollopt),获取用户资料与最近提交,并通过 /v0/maxitem.json 与 /v0/updates.json 支持轮询实时更新。用法:使用 curl 请求各端点,配合 jq 过滤与截取,例如 curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | jq '.[:10]';获取条目详情用 curl -s "https://hacker-news.firebaseio.com/v0/item/<item-id>.json";用户资料用 curl -s "https://hacker-news.firebaseio.com/v0/user/<username>.json"。响应字段包括 id、type、by、time(Unix 时间戳)、title、url、text、score、descendants、kids。限制:官方未记录速率限制,但批量抓取应加延迟并缓存;每个条目需单独请求;部分字段可能为 null 或缺失(如 Ask HN 的 url)。
hackernews
通用与其它
更新于 10-16 02:36