← Projects

NewsHub

A news dashboard that gathers finance, technology, defense and world headlines from 81 sources, entirely in the browser.

Year
2026
Stack
JavaScript, RSS, Reddit JSON, Hacker News API, CoinGecko API
Built
With AI coding assistance
NewsHub, with the market bar above the latest headlines.
NewsHub, with the market bar above the latest headlines.

What it does

NewsHub pulls headlines into seven categories: Finance, Tech and AI, Military, World, Politics, Crypto and Sports.

  • Sources. 58 RSS feeds, 22 subreddits and the top 30 Hacker News stories, none of which needs an API key. NewsAPI can be added with a key of your own.
  • Market bar. Crypto prices from CoinGecko, and SPY, QQQ, DIA and three large stocks from Yahoo’s chart data.
  • Trending topics. The twelve most frequent words across current headlines, after removing common words.
  • Search and filters. Search across titles, descriptions and source names, and filter by category or source type.
  • Refresh. Headlines reload every five minutes and prices every two.

How it is built

  1. No backend. Every request is made by the visitor’s browser, so there is no server to run or pay for. The cost is that the browser’s cross-origin rules block most feeds, which leads to the main limitation below.
  2. Every source is allowed to fail. All sources are requested at once, each with a timeout of nine or ten seconds. A source that fails or times out returns an empty list, and the rest still render.
  3. One shape for every item. RSS entries, Reddit posts and Hacker News stories are each converted to the same record: title, description, link, source, category, time and thumbnail. Everything after that step, including search, sorting and trending, works on one model.
  4. Duplicates are removed by title. Titles are lower-cased, stripped of punctuation and compared on their first 55 characters, so the same story from two feeds appears once.

Security and data handling

  • Every value from a feed is escaped before it is shown, including inside HTML attributes. Links and images are used only if they are http or https URLs, so a feed cannot inject a script link.
  • The only thing kept in the browser’s storage is an optional API key, if the visitor adds one in settings.
  • Two bugs found while reviewing the code are fixed. The percentage change for stocks showed “NaN%” because the data source does not supply a previous close; it is now calculated from the prior day’s closing price, and a missing figure shows a dash. And a faulty selector in the feed parser was discarding every RSS item.

Known limitations

  • It depends on a free public proxy. RSS feeds and stock quotes reach the browser through a third-party relay, which is unreliable. When it is down, only Hacker News and crypto prices load. The proxy also sees each visitor’s IP address and the feeds they request.
  • Reddit often refuses these requests.
  • The status indicator always says “Live”, even when sources have failed.
  • An API key added in settings is stored unencrypted in the browser and sent in the request URL.
  • The market bar’s index labels are the ETFs SPY, QQQ and DIA, not the indexes themselves.
  • There are no retries and no cache, so a failed refresh leaves gaps until the next one.

What I would change

  • Replace the public proxy with a small Cloudflare Worker of my own, with caching, so feeds load reliably and visitors’ requests do not pass through a third party.
  • Show which sources failed instead of a fixed “Live” label.
  • Cache the last good result so a failed refresh does not empty the page.