name: hacker-news description: Scrape Hacker News front page stories including titles, URLs, scores, authors, and comment counts from news.ycombinator.com. Use when the user mentions Hacker News, HN, ycombinator, or wants tech news stories. metadata: author: scrapeagent version: "1.0"
Hacker News Scraper
Overview
Scrapes the Hacker News front page at https://news.ycombinator.com
No JavaScript required — use the fetch tool.
Instructions
Fetch
https://news.ycombinator.comusing the fetch toolThe page has 30 story items. Each story spans two
<tr>elements:- Row 1 (
.athing): title and link - Row 2 (
.subtext): metadata (score, author, comments)
- Row 1 (
For each story extract:
rank:.ranktext, strip the trailing.title:.titleline > atext (first<a>inside.titleline)url:.titleline > ahref — if starts withitem?id=, prependhttps://news.ycombinator.com/domain:.sitebit .sitestrtext (may be empty for HN-internal posts)score:.scoretext, extract the number (e.g., "342 points" → 342)author:.hnusertextage:.age atext (e.g., "3 hours ago")comments: last<a>in.subtext— extract the number, or 0 if "discuss"
Save with columns: rank, title, url, domain, score, author, age, comments
Notes
- HN does not require JS — fetch works fine
- "Ask HN" and "Show HN" posts have internal HN URLs (item?id=...)
- Job posts may have no score/author/comments — handle gracefully with None/empty values
- To scrape a specific page:
https://news.ycombinator.com/?p=2(page 2), etc.