hn-summarize
Installation
SKILL.md
HN Summarize
hckrnews.com is a JavaScript-rendered front end - curling it returns an empty shell, so do not scrape it. Instead use the official Hacker News APIs (Firebase + Algolia), which give the same stories with points, comment counts, and full comment trees. These APIs return plain JSON, so plain curl works fine.
1. Current top stories (the "top 10")
topstories.json returns 500 story IDs in front-page rank order. Take the first N and look up each item.
curl -sL 'https://hacker-news.firebaseio.com/v0/topstories.json' -o /tmp/top.json
python3 -c "
import json,urllib.request
ids=json.load(open('/tmp/top.json'))[:10]
for i,sid in enumerate(ids,1):
d=json.load(urllib.request.urlopen(f'https://hacker-news.firebaseio.com/v0/item/{sid}.json'))
print(f\"{i}. {d.get('title')} | {d.get('score')} pts | {d.get('descendants',0)} comments | id {sid}\")
print(f\" {d.get('url','(text post)')}\")
"