hn-extract
Extract a HackerNews post (article + comments) into single clean Markdown for quick reading or LLM input.
- License 许可
- MIT
- 最近更新
- 2026-04-05
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- hn-extract
- metadata
- { "openclaw": { "os": [ "darwin", "linux", "win32" ], "tags": [ "hn", "hackernews", "comments", "extract", "markdown", "python", "uv", "scraper", "rss", "reader", "summarize" ], "emoji": "?", "always": true, "homepage": "https://github.com/guoqiao/skills/blob/main/hn-extract/hn-extract/SKILL.md", "requires": { "bins": [ "uv" ] } } }
- description
- Extract a HackerNews post (article + comments) into single clean Markdown for quick reading or LLM input.
02 资源文件 2
- 参考文档_meta.json635 B
- 脚本hn-extract.py7.7 KB
03 SKILL.md 正文
HackerNews Extract
Extract a HackerNews post (article + comments) into single clean Markdown for quick reading or LLM input.
see Examples
What it does
- Accepts an HackerNews id, url, or a saved Algolia JSON file.
- Scrapes the linked article content with
trafilatura, cleans HTML, and formats it. - Fetches the story metadata and comment tree from
https://hn.algolia.com/api/v1/items/<id>. - Outputs a readable combined markdown file with original article, threaded comments, and key metadata.
Requirements
uvinstalled and in PATH.
Install
No install beyond having uv.
Dependencies will be installed automatically by uv into to a dedicated venv when run this script.
Usage Workflow (Mandatory for Agents)
When an agent is asked to extract a HackerNews post:
- Run the script with an output path:
uv run --script ${baseDir}/hn-extract.py <input> -o /tmp/hn-<id>.md. - Send ONE combined message: Upload the file and ask the question in the same tool call. Use the
messagetool (action=send,filePath="/tmp/hn-<id>.md",message="Extraction complete. Do you want me to summarize it?"). - Do not output the full text or a summary directly in the chat unless specifically requested.
Usage
# run as uv script
uv run --script ${baseDir}/hn-extract.py <hn-id|hn-url|path/to/item.json> [-o path/to/output.md]
# Examples
uv run --script ${baseDir}/hn-extract.py 46861313 -o /tmp/output.md
uv run --script ${baseDir}/hn-extract.py "https://news.ycombinator.com/item?id=46861313"
uv run --script ${baseDir}/hn-extract.py data/item.json
- Omit
-oto print to stdout. - Directories for
-oare created automatically.
Notes
- Retries are enabled for HTTP fetches.
- Comments are indented by thread depth.
- Article fetch uses
trafilatura.fetch_urlwith liberal SSL handling to make it more usable. - Sites requires authentication or blocks scraping may still fail.
04 同仓库更多 Skills
zyfai
Earn yield on any Ethereum wallet on Base, Arbitrum, and Plasma. Use when a user wants passive DeFi yield on their funds. Deploys a non-custodial subaccount (Safe) linked to their EOA, enables automated yield optimization, and lets them deposit/withdraw anytime.
zerion-api
暂无简介
zerion-api-skill
暂无简介
zerion-api-mcp
暂无简介
yahoo-finance-forex
Fetches real-time FOREX news and market data from Yahoo Finance for major currency pairs (EUR/USD, GBP/USD, USD/JPY, etc.). Analyzes sentiment and provides trading context.
yahoo-finance
This skill should be used when the user asks to "get stock prices", "check stock quotes", "look up earnings", "get financial data", "find trending stocks", or needs stock market data from Yahoo Finance.