How ariskas93/clonernews works
clonernews is a vanilla-JavaScript Hacker News browser. Users navigate feed tabs or open an item; the router renders paginated feeds or post details, while a separate polling loop fetches new and changed items and updates the live panel. The data layer centralizes Hacker News requests and caches items; comments and poll options are rendered as detail-page stages. The README documents the page shell, styling, and poll-ID source; those unsampled relationships are based on documentation, not inspected implementation.
Main entry points: api.js API data access · post.js Post renderer · main.js Hash router · feed.js Feed renderer
Components 17
App interface
- Page shell
index.html - Hash router
js/main.js - Visual styling
css/style.css
Feeds and live updates
- Feed renderer
js/feed.js - Live panel UI
js/feed.js - Live checker
js/live.js - Live event channel
js/live.js
Post details
- Post renderer
js/post.js - Comment renderer
js/comments.js - Poll options
js/post.js
Data and services
- API data access
js/api.js - Item cache
js/cache.js - Poll ID registry
js/polls.js - Shared helpers
js/utils.js
Other components
- Visitor
- Hacker News API
- HN Search API
Connections 28
- Visitor → Page shell: opens app
README.md - Page shell → Hash router: bootstraps
README.md - Hash router → Feed renderer: routes feed
js/main.js - Hash router → Post renderer: routes item
js/main.js - Hash router → Live panel UI: initializes panel
js/main.js - Hash router → Live checker: starts polling
js/main.js - Page shell → Visual styling: uses styling
README.md - Feed renderer → API data access: loads feed pages
js/feed.js - Feed renderer → Shared helpers: throttles and formats
js/feed.js - Feed renderer → Live event channel: listens for updates
js/feed.js - Feed renderer → Post renderer: finds parent post
js/feed.js - Live panel UI → Live event channel: listens for updates
js/feed.js - Live checker → API data access: checks and refreshes
js/live.js - Live checker → Shared helpers: throttles checks
js/live.js - Live checker → Poll ID registry: adds discovered polls
js/live.js - Live checker → Live event channel: dispatches updates
js/live.js - Post renderer → API data access: loads post and options
js/post.js - Post renderer → Shared helpers: formats dates
js/post.js - Post renderer → Comment renderer: renders comments
js/post.js - Post renderer → Poll options: renders poll choices
js/post.js - Comment renderer → API data access: loads comments
js/comments.js - Comment renderer → Shared helpers: formats dates
js/comments.js - Comment renderer → Post renderer: converts text
js/comments.js - Poll options → API data access: loads option items
js/post.js - API data access → Item cache: reads and writes
js/api.js - API data access → Poll ID registry: gets poll IDs
js/api.js - API data access → Hacker News API: fetches item data
js/api.js - Poll ID registry → HN Search API: IDs sourced from
js/polls.js