← 返回
AI智能 中文

HackerNews Extract

Extract a HackerNews post (article + comments) into single clean Markdown for quick reading or LLM input.
将黑客新闻帖子(含文章与评论)提取为整洁的Markdown,便于快速阅读或作为大语言模型输入。
guoqiao
AI智能 clawhub v0.1.5 1 版本 99846.7 Key: 无需
★ 4
Stars
📥 3,829
下载
💾 871
安装
1
版本
#comments#extract#hackernews#hn#latest#markdown#python#reader#rss#scraper#summarize#uv

概述

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 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

  • uv installed 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:

  1. Run the script with an output path: uv run --script ${baseDir}/hn-extract.py -o /tmp/hn-.md.
  2. Send ONE combined message: Upload the file and ask the question in the same tool call. Use the message tool (action=send, filePath="/tmp/hn-.md", message="Extraction complete. Do you want me to summarize it?").
  3. 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"
  • Omit -o to print to stdout.
  • Directories for -o are created automatically.

Notes

  • Retries are enabled for HTTP fetches.
  • Comments are indented by thread depth.
  • Sites requires authentication or blocks scraping may still fail.

版本历史

共 1 个版本

  • v0.1.5 当前
    2026-03-28 11:59 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 836 📥 213,135
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,832
data-analysis

Media Downloader

guoqiao
从 YouTube/Bilibili/X 等下载视频/音乐
★ 5 📥 3,528