详细分析 ▾
运行时依赖
版本
hn-extract 0.1.5 - Updated documentation to clarify accepted inputs: now specifies support for only HackerNews ID or URL, removing reference to saved Algolia JSON files. - Examples and usage instructions streamlined to match supported input types. - Notes section updated to remove mention of article retrieval using trafilatura and Algolia specifics.
安装命令 点击复制
技能文档
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 or url
- Download the linked article HTML, cleans and formats it.
- Fetches the Hacknews post metadata and comments.
- 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 -o /tmp/hn-..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-,.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 [-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"
- Omit
-oto print to stdout. - Directories for
-oare created automatically.
Notes
- Retries are enabled for HTTP fetches.
- Comments are indented by thread depth.
- Sites requires authentication or blocks scraping may still fail.
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制