jcrabapple/hermes-skills/hackernews-scraper

Claude Code and agent skill by jcrabapple/hermes-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Scrape top Hacker News stories, filter by topic or keyword, and return structured JSON data including titles, URLs, scores, and comment counts.

Install

npx vskill@latest install jcrabapple/hermes-skills/hackernews-scraper

SKILL.md

The same SKILL.md was published earlier as jcrabapple/hermes-skills/hackernews-scraper.

HackerNews Scraper

Scrape top Hacker News stories with filtering and search capabilities.

Quick Start

Basic Usage
bash
# Get top stories
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | head -20
# Get story details
curl -s "https://hacker-news.firebaseio.com/v0/item/12345.json"
Filter by Topic
bash
# Scrape stories with AI/ML keywords
curl -s "https://hacker-news.firebaseio.com/v0/topstories.json" | xargs -I {} curl -s "https://hacker-news.firebaseio.com/v0/item/{}.json" | jq 'select(.title | contains("AI") or contains("machine learning"))'

Story Types

TypeEndpoint
Top/v0/topstories.json
New/v0/newstories.json
Best/v0/beststories.json
Ask/v0/askstories.json
Show/v0/showstories.json
Job/v0/jobstories.json

Response Schema

json
{
"id": 12345,
"title": "Show HN: My Project",
"url": "https://example.com",
"score": 150,
"by": "username",
"time": 1234567890,
"descendants": 45,
"type": "story"
}

Common Tasks

TaskExample
Get top 30curl -s ".../topstories.json"jq '.[0:30]'
Filter by scorejq 'select(.score > 100)'
Get comments/v0/item/{id}.json -> .kids

Python Implementation

For programmatic processing (recommended over shell commands):

python
import requests
def fetch_hn_stories(story_type='top', limit=10, min_score=0):
"""
Fetch Hacker News stories with filtering.
story_type: 'top', 'new', 'best', 'ask', 'show', 'job'
Returns list of story dicts with: id, title, url, score, by, time, descendants
"""
type_map = {
'top': 'topstories',
'new': 'newstories',
'best': 'beststories',
'ask': 'askstories',
'show': 'showstories',
'job': 'jobstories'
}
# Get story IDs
response = requests.get(
f"https://hacker-news.firebaseio.com/v0/{type_map.get(story_type, 'topstories')}.json"
)
story_ids = response.json()[:limit]
# Fetch details for each story
stories = []
for story_id in story_ids:
story_response = requests.get(
f"https://hacker-news.firebaseio.com/v0/item/{story_id}.json"
)
story = story_response.json()
if story and story.get('score', 0) >= min_score:
stories.append({
'id': story.get('id'),
'title': story.get('title'),
'url': story.get('url', f"https://news.ycombinator.com/item?id={story_id}"),
'score': story.get('score', 0),
'author': story.get('by', 'unknown'),
'comments': story.get('descendants', 0),
'time': story.get('time'),
'type': story.get('type')
})
return stories
# Example usage
stories = fetch_hn_stories(story_type='top', limit=10, min_score=50)
for s in stories:
print(f"{s['title']} ({s['score']} points by @{s['author']})")

Email Delivery Integration

For cron jobs, use the self-contained script pattern — the script fetches stories, enriches with LLM summaries, and sends email directly. This avoids security scanner blocks on .dev TLDs in story URLs (heredoc execution is blocked in cron mode).

Production script: ~/.hermes/scripts/hn_enriched.py — fetches top 10 stories, enriches via Gemini 2.5 Flash (NanoGPT), sends formatted HTML+text email via AgentMail SDK.

Key pitfalls:

  • Do NOT use Qwen 3.5 thinking models via NanoGPT for structured JSON — content field is always empty, output goes to reasoning field. Use google/gemini-2.5-flash instead.
  • Cron agent prompt should just confirm script output — do NOT have the agent send email via terminal heredoc (triggers .dev TLD security scanner block).
python
import sys
sys.path.insert(0, '/var~.hermes/skills/agentmail/agentmail/scripts')
from agentmail_helper import get_client
stories = fetch_hn_stories(limit=10)
html_body = format_stories_as_html(stories) # Your formatting function
text_body = format_stories_as_text(stories)
client = get_client()
client.inboxes.messages.send(
inbox_id='you@example.com',
to='you@example.com',
subject='Weekly HackerNews Top 10',
text=text_body,
html=html_body
)

See github-trending skill for a complete weekly email digest pattern.

Error Handling

  • API is read-only and rarely rate-limits
  • Missing stories return null
  • Use jq for shell JSON parsing
  • In Python, requests handles JSON automatically
  • Always check for None responses when fetching individual stories

Inputs

NameTypeDescriptionRequired
topictextTopic or keyword to filter stories by (e.g. "AI", "Rust", "startups")No
story_typetextType of stories to fetch: topnewbestaskshow. Defaults to "top".No
min_scorenumberMinimum score threshold. Stories below this are excluded. Defaults to 0.No
limitnumberMaximum number of stories to return. Defaults to 20, max 100.No

Outputs

NameTypeDescriptionRequired
storiesjsonJSON array of story objects with fields: id, title, url, score, by, time, descendants (comment count), type.Yes

Required Tools

  • web_fetch
  • json_parse

Compatible Skills

  • ai-paper-summarizer
  • slack-notifier
  • markdown-report-generator
  • web-search-aggregator

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jcrabapple/hermes-skills/hackernews-scraper/badge)](https://verified-skill.com/skills/jcrabapple/hermes-skills/hackernews-scraper)

Something wrong with this skill or its page? Tell us.