A minimalist Hacker News.
Link: https://proc0.github.io/HackerZen
Popular posts on Hacker News with thousands of comments slow down even powerful desktop machines. Despite its simple UI, it loads all replies at once with a lot of HTML stuttering the browser rendering.
Hacker Zen adds incremental loading of posts and replies with a minimal UI for a better experience. It has zero dependencies for its static version (read-only version of the site), using plain JS and CSS, and it caches posts and replies using IndexedDB to avoid double fetching.
- Minimal UI
- Local caching
- Static site (read-only)
- No dependencies
- Mobile friendly
- Easily extensible
- load posts and comments for Top, New, Best, Jobs, Ask, and Show
- upvote posts and comments (requires local server)
- reply to comments (requires local server)
- load user posts (requires local server)
https://proc0.github.io/HackerZen
Clone the repo, open index.html! This will load the static, read-only version. This is more or less like browsing Hacker News without being logged in.
In order to have write capabilities (i.e. upvoting, downvoting, replying), the requests need the user cookie, and as of right now there is no easy way to use the official /login to obtain this.
The workaround is to copy the cookie into an environment variable. The local server will look for HN_COOKIE, and use that for POST requests.
- Clone the repo
- Install dependencies
npm install - Login to Hacker News
- Open DevTools or equivalent (i.e. Ctrl+Alt+I)
- Copy the user cookie
- Paste into an environment variable
- (Windows) Powershell
$env:HN_COOKIE="<insert here>" - (*nix) Bash
$HN_COOKIE=<insert here>
- (Windows) Powershell
- Run the server with
node . - Navigate to
localhost:3000
No build is needed, but there is a Parcel dep and a script to bundle js to avoid serving lots of files. Work in progress.
- Support for post submition and editing comments
- Theme editor, choose custom colors
- Settings, i.e. how many comments to load
- Infinite scrolling