hn-extract

Extract HackerNews posts and threaded comments into a Markdown file.

Updated Feb 1, 2026
One-click install
npx skills add https://github.com/guoqiao/skills --skill hn-extract
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hn-extract
Source: https://github.com/guoqiao/skills/tree/main/hn-extract/hn-extract
Command: npx skills add https://github.com/guoqiao/skills --skill hn-extract

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, trafilatura, urllib3, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the process of extracting the main article content and all comments from a HackerNews post, consolidating them into a single, clean Markdown file for easier reading or input into LLMs.

Core Features & Use Cases

  • Article Extraction: Downloads and cleans the HTML of the linked article, extracting only the main text.
  • Comment Threading: Fetches all comments associated with the HackerNews post and preserves their threaded structure.
  • Metadata Inclusion: Includes key metadata like title, author, URL, and points.
  • Use Case: When you find an interesting HackerNews post with many comments, use this Skill to get a consolidated, readable version of the article and discussion without navigating the website or dealing with ads.

Quick Start

Use the hn-extract skill to extract the HackerNews post with ID 46861313 into a Markdown file.

Frequently Asked Questions about hn-extract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract HackerNews posts and comments into a single Markdown file?

To extract HackerNews posts and comments into Markdown, provide a post URL or item ID to the scraper. It downloads the article text and fetches threaded comments, consolidating everything into one clean file for offline reading or LLM input.

What is the best way to save HackerNews threaded comments for LLM consumption?

Saving HackerNews threaded comments for LLM consumption is best handled by a scraper that preserves the hierarchical comment structure. This approach fetches all replies and main article text, outputting a structured Markdown file that language models can easily parse.

Do I need the uv Python package manager to run the HackerNews scraper?

Yes, you need the uv Python package manager to run the HackerNews scraper. It handles script execution and manages dependencies like requests, trafilatura, and urllib3, ensuring the Python environment is correctly set up for extracting HTML content.

Can I use a HackerNews item ID instead of a URL to extract the post content?

Yes, you can use a HackerNews item ID instead of a URL to extract post content. The scraper accepts either input format, fetching the main article and associated threaded comments based on the unique item identifier provided.

Does the HackerNews extractor include post metadata like points and author?

Yes, the HackerNews extractor includes post metadata like points and author. Alongside the cleaned article HTML and threaded comments, the generated Markdown file contains key metadata such as the post title, author, URL, and points.

What limitations exist when extracting HTML content from linked HackerNews articles?

A limitation when extracting HTML content from linked HackerNews articles is that the tool relies on the trafilatura library to clean HTML and extract main text. If the linked website blocks scraping or has complex JavaScript rendering, the extraction may fail or return incomplete content.