hackernews-frontpage

Scrapes the Hacker News front page and returns stories as structured JSON.

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/raghavbadhwar/rstack --skill hackernews-frontpage-raghavbadhwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hackernews-frontpage
Source: https://github.com/raghavbadhwar/rstack/tree/main/browser-skills/hackernews-frontpage
Command: npx skills add https://github.com/raghavbadhwar/rstack --skill hackernews-frontpage-raghavbadhwar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Manually checking Hacker News for top stories is repetitive, and building a scraper from scratch requires handling HN's specific HTML structure, entity decoding, and edge cases like job postings. This Skill navigates to news.ycombinator.com through a browser daemon, parses the stable tr.athing row structure, and emits the top stories as a single typed JSON document with rank, title, URL, points, and comment counts. ## Core Features & Use Cases - Structured story extraction: Parses each HN front-page row into a typed record with rank, item id, title, outbound URL, point count, and comment count, decoding HTML entities automatically. - Edge-case handling: Treats "discuss" links as zero comments and returns null points/comments for YC job postings that lack scores. - Fixture-tested parser: The pure parseStoriesFromHtml function is exercised against a bundled HTML fixture, so selector breakage from HN markup changes is caught by tests before users notice. - Use Case: Ask your agent for the current top Hacker News stories and receive a JSON array you can pipe into a digest, trend monitor, or content research workflow. ## Quick Start Ask the agent to run the hackernews-frontpage skill and return the current top Hacker News stories as JSON.

Frequently Asked Questions about hackernews-frontpage

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

FAQPage Schema
How do I scrape the Hacker News front page?

Run the skill via `$B skill run hackernews-frontpage`; it navigates to news.ycombinator.com through the browser daemon, parses each story row, and prints a JSON document with stories and a count to stdout.

What data does the Hacker News scraper return for each story?

Each story includes a 1-based rank, the HN item id, title, outbound URL, point count, and comment count. Job postings without scores return null for points and comments, and 'discuss' links count as zero comments.

Does the HN scraper need authentication or an API key?

No HN authentication is needed since the front page is public. The script does require the gstack browser daemon: it resolves a port and scoped token from GSTACK_PORT and GSTACK_SKILL_TOKEN env vars, or from a .gstack/browse.json state file when run directly.

Why does the HN scraper break when the site HTML changes?

The parser depends on HN's stable tr.athing row structure and titleline/score CSS classes. If HN rotates its markup, the bundled fixture test fails first, signaling that the selectors in parseStoriesFromHtml need updating.

Can I test the HN parser without a browser or network?

Yes. parseStoriesFromHtml is a pure function over HTML strings, and script.test.ts runs it against a bundled fixture file using bun:test, with no daemon or network access required.