Public
Likehn-watcher
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
Real-time Hacker News user & item watcher with Firebase SSE streaming and Web Push notifications.
- Multi-user β sign in with Val Town, each user has their own watch list
- Watch HN users β get notified on new posts, comments, karma changes, profile edits
- Watch HN items β track score changes, new comments on stories
- Browse HN feeds β Top, Ask HN, Show HN, and Jobs in tabbed feed view
- Real-time via Firebase SSE β browser connects directly to Firebase for instant updates
- Web Push notifications β native browser notifications even when tab is closed
- Interval backup poller β catches everything every 5 minutes when no browser is open
- Tabbed UI β Notifications front-and-center by default, HN Stories in a second tab
- Collapsible watch settings β keep the UI clean, expand when you need to add/remove watches
Rendering mermaid diagram...
- Sign in with your Val Town account
- Add HN usernames or item IDs to your personal watch list (via collapsible Watch Settings panel)
- Browse HN feeds β switch between Top, Ask HN, Show HN, and Jobs tabs; watch items directly from the feed
- The browser opens EventSource connections directly to Firebase for each watched entity
- When Firebase pushes changes, the client-side diff engine detects what changed
- Changes are reported to the backend, stored per-user in SQLite, and trigger Web Push notifications
- The Notifications tab (default view) shows your activity feed; switch to HN Stories to browse
- When the browser is closed, the interval val polls every 5 min and sends push to all affected users
| Endpoint | Description |
|---|---|
GET /api/hn/:feed | Proxy to HN Firebase API. Feeds: top, ask, show, jobs, new, best |
GET /api/watched | Get current user's watched users & items |
GET /api/events | Get current user's activity events |
POST /api/watch/user | Add a HN user to watch |
POST /api/watch/item | Add a HN item to watch |
POST /api/subscribe | Register push subscription |
POST /api/test-push | Send test push notification |
- Go to
/setupto generate and save VAPID keys (needed for Web Push) - Open the dashboard at
/ - Sign in with Val Town
- Click "Enable Notifications" for Web Push
- Add HN usernames or item IDs to watch
VAPID_KEYSβ ECDSA P-256 keypair in JWK format (generate at/setup)VAPID_SUBJECTβmailto:contact email for VAPID