返回顶部
H

Hacker News

Search and browse Hacker News with API access to stories, comments, users, and hiring threads.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,780
下载量
0
收藏
概述
安装方式
版本历史

Hacker News

## Quick Reference | Topic | File | |-------|------| | API endpoints | `api.md` | | Search patterns | `search.md` | ## Core Rules ### 1. Two APIs Available | API | Use Case | Base URL | |-----|----------|----------| | Official HN API | Single items, real-time | `https://hacker-news.firebaseio.com/v0` | | Algolia Search | Full-text search, filters | `https://hn.algolia.com/api/v1` | ### 2. Official API Endpoints - `/topstories.json` — top 500 story IDs - `/newstories.json` — newest 500 story IDs - `/beststories.json` — best stories - `/askstories.json` — Ask HN - `/showstories.json` — Show HN - `/jobstories.json` — job postings - `/item/{id}.json` — story/comment details - `/user/{username}.json` — user profile ### 3. Algolia Search Syntax ``` /search?query=TERM&tags=TAG&numericFilters=FILTER ``` **Tags (combinable with AND):** - `story`, `comment`, `poll`, `job`, `ask_hn`, `show_hn` - `author_USERNAME` — posts by user - `story_ID` — comments on story **Numeric filters:** - `created_at_i>TIMESTAMP` — after date - `points>N` — minimum points - `num_comments>N` — minimum comments ### 4. Common Patterns | Request | Endpoint | |---------|----------| | Frontpage | Official `/topstories.json` → fetch first 30 items | | Search posts | Algolia `/search?query=X&tags=story` | | User's posts | Algolia `/search?tags=author_USERNAME` | | Who is hiring? | Algolia `/search?query=who is hiring&tags=story,author_whoishiring` | | Comments on story | Algolia `/search?tags=comment,story_ID` | | This week's top | Algolia `/search?tags=story&numericFilters=created_at_i>WEEK_TS` | ### 5. Response Handling - Official API returns IDs → batch fetch items (parallelize) - Algolia returns full objects with `hits[]` array - Story object: `id`, `title`, `url`, `score`, `by`, `time`, `descendants` (comment count) - Comment object: `id`, `text`, `by`, `parent`, `time` ### 6. Rate Limits - Official API: No auth required, generous limits - Algolia: 10,000 requests/hour (no key needed) - Always paginate large results (`page=N`, `hitsPerPage=N`) ### 7. Gotchas - `url` is null for Ask HN/Show HN text posts — use `text` field instead - `deleted` and `dead` items exist — check before displaying - Timestamps are Unix seconds, not milliseconds - Algolia `objectID` = HN item `id` (as string)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 hacker-news-1776420052 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 hacker-news-1776420052 技能

通过命令行安装

skillhub install hacker-news-1776420052

下载 Zip 包

⬇ 下载 Hacker News v1.0.0

文件大小: 3.62 KB | 发布时间: 2026-4-17 18:21

v1.0.0 最新 2026-4-17 18:21
Initial release

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部