A drop in replacement for Hacker News with support for dark mode and more.

Overview

Worker News

A drop in replacement for Hacker News with support for dark mode, quotes in comments, user identicons and submission favicons.

Screenshot

What's cool about this?

  • Developed against a generic Worker Runtime so that it can run on Cloudflare Workers, Deno Deploy and even the browser's Service Worker.
  • Can be installed + offline support: Same code that runs on the edge powers the PWA.
  • Everything is stream/async generator-based: API calls, HTML scraping, HTML responses, even JSON stringification and parsing.
  • Supports 3 API backends: HTML scraping from news.ycombinator.com, HTTP requests to HN API and HN API via Firebase.
  • Built using my own web framework, Worker Tools, which is specifically developed to run across CF Workers, Deno and Service Workers.

Notes

  • The PWA is optional. This app is just HTML streamed from the edge. If the PWA is installed, it is JSON streamed from the edge + HTML streamed from the Service Worker.
  • PWA requires latest browsers. FF only works when TransformStreams are enabled in in about:config.
  • A side effect of this approach is very low TTFB. This version feels faster than HN itself, even when it might be slower.
  • Not everything that HN supports is supported by the HN API. The HN API is missing many properties, such as # of descendants of a comment and comment quality (used to gray out downvoted comments). The HTML scraping API doesn't have this problem, but it quickly runs into a scrape shield, especially for infrequently requested sites. Works well when running on your own machine though (scrape shield seems to be more forgiving for new IPs).

Development

You can run the worker locally either via Wrangler, Node+Miniflare or Deno CLI. For Node/Wrangler it's best to install dependencies via pnpm (lockfile checked in), but npm or yarn is probably fine too.

Then run npm start and open http://localhost:8787. If you have Wrangler 2.0 is installed, run wrangler dev --local instead.

Deno users can simply run deno task serve and open http://localhost:8000.

Note on Running on Cloudflare Workers

While the app runs fine with Miniflare/wrangler dev --local, it works poorly when running on Cloudflare's edge network. The reason is that the HN API is not usable from CF Workers. Firebase is missing dependencies in the runtime (probably WebSocket or similar), while the REST API runs into CF Workers' 50 subrequest limit. This only leaves the DOM API (HTML scraping), which usually triggers HN's scrape shield...

You might also like...

Tampermonkey script which adds the ability to add a user-defined label/tag/flair on a user, shown throughout Hacker News.

Hacker News User Tags Hacker News User Tags is a Tampermonkey userscript which allows the user to associate a custom coloured label/tag on usernames t

Oct 7, 2022

A Drop-in Jalali Replacement for filament DateTimePicker

Filament Jalali Date Time Picker Field This package is a Drop-in replacement for DatePicker and DateTimePicker field type you just need to replace tho

Dec 3, 2022

An efficient drop-in replacement for JSON.

An efficient drop-in replacement for JSON.

JCOF: JSON-like Compact Object Format A more efficient way to represent JSON-style objects. Status This format isn't nailed down yet. Most changes wil

Nov 26, 2022

News API Wrapper for Violetics API News

News API Wrapper for Violetics API News

Mar 23, 2022

ZaDark is an open source extension that helps you enable Dark Mode for Zalo on PC and Browser.

ZaDark is an open source extension that helps you enable Dark Mode for Zalo on PC and Browser.

ZaDark – Zalo Dark Mode Table of Contents About Install Roadmap Contributing License Contact Awards Acknowledgments About ZaDark is an open source ext

Dec 22, 2022

chakra-radix-colors provides radix-ui color palettes, automatic dark mode, and acessible colors to chakra-ui applications

chakra-radix-colors chakra-radix-colors provides radix-ui color palettes, automatic dark mode, and acessible colors to chakra-ui applications. About C

Dec 30, 2022

Stylesheet and scripts for implementing dark mode with Bootstrap 4

Bootstrap Darkmode This project provides a stylesheet and two scripts that allow you to implement a dark theme on your website. It is initially loaded

Nov 27, 2022

A TailwindCSS variant for class-based dark mode with CSS Modules.

A TailwindCSS variant for class-based dark mode with Svelte's scoped stylesheets and CSS modules. If you've ever tried to use TailwindCSS dark mode wi

Dec 1, 2022

Force dark mode for all web pages.

Dark Mode [WIP] Force dark mode for all web pages. Instalation Enable Epiphany extension. Optional if not done. Download the latest release from the .

Dec 2, 2022
Owner
Worker Tools
Utilities for working with worker runtimes such as Cloudflare Workers and Deno Deploy
Worker Tools
MDN-Dark-Mode - Simple extension to add a dark mode with different themes to the MDN Web Docs website

MDN-Dark-Mode Information Chrome and Firefox extension that adds a dark mode wit

Santiago GalΓ‘n Barlo 2 Mar 18, 2022
DoMe is a ToDo App. you can add, delete and reorder elements of the todo list using drag and drop. You can also toggle between dark&light mode

DO ME Todo App Live Preview : DO ME Built With : - ReactJS - TailwindCSS Make sure you have: - Git - Nodejs version 14 or higher (we recommend using

Medjahdi Islem 5 Nov 18, 2022
πŸŒ“ Add dark mode/night mode custom elements to your website.

dark-mode A custom element that allows you to easily put a Dark Mode ?? toggle. so you can initially adhere to your users' preferences according to pr

ε°εΌŸθ°ƒθ°ƒβ„’ 12 Oct 20, 2022
Perfect SvelteKit dark mode in 2 lines of code. Support System preference and any other theme with no flashing

This library is a port of next-theme for SvelteKit. All credit goes to pacocoursey and all next-themes contributors While usable, this library is stil

null 42 Sep 30, 2022
Lets you add a character to Hacker News links to add social media and OpenGraph previews for sharing on things like Slack or Twitter.

news.ycombinator1.com Lets you add a character to Hacker News links to add social media and OpenGraph previews for sharing on things like Slack or Dis

Ian Langworth ☠ 38 Sep 18, 2022
This is an unofficial front end for Hacker News, reminiscent of the Windows XP era Outlook email client on a Windows XP default desktop

Hacker XP Hacker News styled as the Windows XP Outlook email client. Try out Hacker XP here! Description This is an unofficial front end for Hacker Ne

null 19 Jul 12, 2022
A Hacker News style forum, built on the Lens Protocol.

Refract A Hacker News style forum, built on the Lens Protocol This starter kit is composed of Next.js and Tailwind CSS, with RainbowKit, ethers, & wag

Miguel Piedrafita 65 Dec 2, 2022
swyx's hacker news chrome extension

Hacker News Extended This is an extension for Google Chrome that: displays the latest links from Y Combinator's Hacker News Offers a link for submitti

swyx 15 Jul 21, 2022
πŸ‘¨β€πŸ’» β€’ CURL client for Hacker News πŸ“° πŸ“°

βš™οΈ Hkkr.in ?? The easiest way to get your daily hourly Hacker News dosage! Usage β€’ Contributing β€’ ToDo Hkkr.in is a Curl client for Hacker News I spen

Ajith 23 Dec 11, 2022