hn-search
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "hn-search":https://skillpi.com/zh/skills/deepskill-f0d0cfdcdc4453f7bd2bb9f0246a6dc847fc4547dd4a6184003b736c801391d2。安装前核对上游来源和版本:https://github.com/dylanfeltus/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
通过免费的 Algolia API 在 Hacker News 上搜索和监控文章、评论及用户。当用户询问 HN 讨论、查找特定主题文章或监控 HN 提及时使用。无需 API 密钥。
介绍来源: third_party · dylanfeltus · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: hn-search
description: Search and monitor Hacker News stories, comments, and users via the free Algolia API. Use when the user asks about HN discussions, wants to find posts about a topic, or monitor HN for mentions. No API key required.Hacker News Search
Search and monitor Hacker News stories, comments, and users via the Algolia HN Search API. No API key required.
When to Use
- User asks about Hacker News discussions on a topic
- User wants to find HN posts about a company, product, or technology
- User wants to monitor HN for mentions of something
- User asks "what's trending on HN" or "what did HN think about X"
- User wants to find Show HN / Ask HN / Launch HN posts
API Overview
Base URL: https://hn.algolia.com/api/v1
Two search endpoints:
/search— Relevance-sorted (best for finding specific topics)/search_by_date— Date-sorted (best for monitoring / recent activity)
Rate Limits: 10,000 requests/hour (generous, no auth needed)
How to Search
Step 1: Build the URL
https://hn.algolia.com/api/v1/search?query=QUERY&tags=TAG&hitsPerPage=N&numericFilters=FILTERS
Step 2: Fetch with web_fetch
Use web_fetch to call the API. Response is JSON.
Parameters
| Parameter | Description | Example |
|---|---|---|
query |
Search terms (URL-encoded) | query=openai+gpt |
tags |
Filter by type (see below) | tags=story |
hitsPerPage |
Results per page (max 1000) | hitsPerPage=20 |
page |
Page number (0-indexed) | page=0 |
numericFilters |
Numeric filters (see below) | numericFilters=points>100 |
Tag Filters
Use tags to filter by content type:
| Tag | Description |
|---|---|
story |
Stories only |
comment |
Comments only |
show_hn |
Show HN posts |
ask_hn |
Ask HN posts |
front_page |
Currently on front page |
author_USERNAME |
Posts by a specific user |
story_ID |
Comments on a specific story |
Combine tags with commas (AND) or parentheses with commas (OR):
tags=story,show_hn→ Show HN stories (AND)tags=(story,comment)→ Stories OR comments
Numeric Filters
| Filter | Description |
|---|---|
points>N |
Minimum points/upvotes |
num_comments>N |
Minimum comments |
created_at_i>TIMESTAMP |
After Unix timestamp |
created_at_i<TIMESTAMP |
Before Unix timestamp |
Combine with commas: numericFilters=points>100,num_comments>50
Date Ranges
To search within a time window, use Unix timestamps with created_at_i:
Calculate the current Unix timestamp first (e.g., via exec: date +%s), then subtract:
| Window | Subtract from now |
|---|---|
| Last 24 hours | - 86400 |
| Last 7 days | - 604800 |
| Last 30 days | - 2592000 |
Example: if now is 1705312200, last 7 days = numericFilters=created_at_i>1704707400
Response Format
Each hit contains:
{
"objectID": "12345",
"title": "Story Title",
"url": "https://example.com/article",
"author": "username",
"points": 150,
"num_comments": 42,
"created_at": "2024-01-15T10:30:00Z",
"created_at_i": 1705312200,
"story_text": "Text for Ask HN / Show HN (HTML)",
"_tags": ["story", "author_username", "story_12345"]
}
For comments, hits also include:
{
"comment_text": "The comment body (HTML)",
"story_id": 12345,
"story_title": "Parent Story Title",
"story_url": "https://example.com",
"parent_id": 12344
}
The response wrapper includes:
{
"hits": [...],
"nbHits": 1000,
"page": 0,
"nbPages": 50,
"hitsPerPage": 20
}
Constructing HN Links
- Story:
https://news.ycombinator.com/item?id={objectID} - Comment:
https://news.ycombinator.com/item?id={objectID} - User:
https://news.ycombinator.com/user?id={author}
Step-by-Step Instructions
Searching for Stories on a Topic
- URL-encode the query
- Fetch:
https://hn.algolia.com/api/v1/search?query=YOUR_QUERY&tags=story&hitsPerPage=10 - Parse the JSON response
- For each hit, present: title, points, num_comments, author, date, HN link, and original URL
Finding Recent/Trending Discussions
- Calculate Unix timestamp for your time window (e.g., 7 days ago)
- Fetch:
https://hn.algolia.com/api/v1/search?query=YOUR_QUERY&tags=story&numericFilters=points>50,created_at_i>TIMESTAMP&hitsPerPage=10 - Sort results by points or comments for "trending"
Getting Comments on a Story
- Get the story's objectID from a search
- Fetch:
https://hn.algolia.com/api/v1/search?tags=comment,story_STORYID&hitsPerPage=20 - Present comment_text, author, points for each
Monitoring a Topic (Show Recent Mentions)
- Use
/search_by_dateinstead of/search - Fetch:
https://hn.algolia.com/api/v1/search_by_date?query=YOUR_QUERY&tags=(story,comment)&hitsPerPage=20 - Results are newest-first — useful for "what's new about X on HN"
Finding a User's Posts
- Fetch:
https://hn.algolia.com/api/v1/search?tags=author_USERNAME,story&hitsPerPage=20 - For their comments:
tags=author_USERNAME,comment
Output Format
Present results as a clean list:
### HN Results for "query" (N total)
1. **Story Title** (150 pts, 42 comments)
By username · Jan 15, 2024
🔗 https://example.com/article
💬 https://news.ycombinator.com/item?id=12345
2. ...
For comments:
### HN Comments on "Story Title"
1. **username** (12 pts) · Jan 15, 2024
> First ~200 chars of the comment text...
💬 https://news.ycombinator.com/item?id=12345
Error Handling
- Empty results: Tell the user no results were found. Suggest broadening the query or removing filters.
- API error / timeout: Retry once. If still failing, inform the user the HN search API may be temporarily down.
- Rate limited (429): Unlikely at 10k/hr, but if hit, wait 60 seconds and retry.
- Malformed response: Check the URL construction — common issues are unencoded special characters in the query.
Examples
Example 1: "What's HN saying about Rust?"
Fetch: https://hn.algolia.com/api/v1/search?query=rust+programming&tags=story&hitsPerPage=5&numericFilters=points>50
Example 2: "Find Show HN posts about AI agents from the last month"
# Calculate timestamp for 30 days ago, then:
Fetch: https://hn.algolia.com/api/v1/search_by_date?query=ai+agents&tags=show_hn&numericFilters=created_at_i>TIMESTAMP&hitsPerPage=10
Example 3: "What has pg posted recently?"
Fetch: https://hn.algolia.com/api/v1/search_by_date?tags=author_pg&hitsPerPage=10
Data Source
Algolia HN Search API — Free, no authentication required. Indexes all public Hacker News content in near real-time.
当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供通过 Algolia API 搜索和监控 Hacker News 内容的实用能力
- 适用于查找 HN 讨论、特定主题文章或监控提及信息等多种场景
- 无需 API 密钥,使用门槛低
亮点
- 触发词描述清晰,覆盖多种使用场景
- 边界清晰,不易与其他 Skill 重叠
亮点
- 结构完整,包含多个必要章节
- 步骤清晰,有详细的端到端示例
- frontmatter 完整,文档组织良好
亮点
- 工具来源明确,参数说明详细
- 覆盖了主要异常情况并提供处理建议
- API 文档完整,执行流程可靠
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 3, 8 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- example.com
- hn.algolia.com
- news.ycombinator.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。