A Scriptable widget that shows the top 10 Hacker News stories on your iPhone home screen, with live data straight from the official HN API.
- Top 10 stories from Hacker News, refreshed automatically by iOS
- Numbered badges so you always know the ranking at a glance
- Two tap targets per story:
- Tap the title → opens the article
- Tap the meta row (points · comments · time) → opens the HN comments thread
- Ask HN / Show HN posts (no external URL) fall back to the comments page on both taps
- Dark purple gradient background that sits cleanly on any home screen
- Built entirely with the Scriptable JavaScript API — no server, no backend, no tracking
- iPhone with Scriptable installed (free)
- Install Scriptable from the App Store
- Open Scriptable and tap + to create a new script
- Copy the contents of
hacker-news-widget.jsand paste it into the script editor - Tap Run once to verify it works — a large widget preview will appear
- Go to your home screen, long-press, tap +, and add a Scriptable widget in the large size
- Long-press the widget → Edit Widget, then set Script to the script you just created
When the widget runs, it:
- Fetches the current top story IDs from the HN Firebase API
- Loads the details for the top 10 in parallel
- Renders each story as a row with a rank badge, title, and a meta line showing points, comment count, and age
- Sets deep-link URLs on the title and meta stacks independently so each tap target opens the right destination
iOS refreshes the widget automatically in the background based on its own scheduling — typically every 15–60 minutes.
All tuneable values are at the top of the script in the CONFIG object:
| Key | Default | Description |
|---|---|---|
storyCount |
10 |
Number of stories to fetch and display |
colors.* |
— | All colours used in the widget |