4chan RSS bridge
A local service that turns 4chan's read-only JSON API into RSS 2.0 and Atom 1.0 feeds, so any RSS reader can follow boards, catalog pages, threads and archives without a browser, a userscript, or an account.
Point your reader at http://127.0.0.1:8080/g.rss and you are done.
Why
4chan has no feeds. It does have a clean, documented, read-only JSON API at
a.4cdn.org. This bridge sits between the two: it fetches JSON, renders the
post markup into a safe HTML subset, and emits standards-compliant feeds with
per-post permalinks, image enclosures and correct timestamps.
It is read-only by construction. It only ever issues GET requests to
a.4cdn.org and never touches sys.4chan.org, so it cannot post, vote, report
or authenticate.
Features
- Every board as a feed, plus per-catalog-page feeds.
- Thread feeds with one entry per post, each linking to its own permalink.
- Archive feeds for boards that keep one.
- RSS 2.0 and Atom 1.0 from the same URL space; swap
.rssfor.atom. - Image enclosures with correct MIME type and byte length.
- Markup fidelity: greentext, quote links, dead links, spoilers,
strikethrough, underline,
<wbr>word breaks and[code]blocks. - Sanitised output: only a fixed tag vocabulary is re-emitted, so a hostile
post cannot inject script, style, event handlers or
javascript:URLs. - OPML export at
/opmlto import all 77 boards in one go. - Caching with a configurable TTL.
- Zero dependencies beyond the Go standard library.
Install
Requires Go 1.26 or newer.
git clone https://huggingface.co/abr00kx/4chan-rss-bridge
cd 4chan-rss-bridge
make build
./4chan-rss-bridge
Then open http://127.0.0.1:8080/ for a browsable index of every board.
URL patterns
| URL | Feed |
|---|---|
/ |
HTML index of every board |
/opml |
OPML subscription list for all boards |
/boards.json |
Raw board list, passed through |
/{board}.rss |
Whole board catalog, newest threads first |
/{board}/{page}.rss |
One catalog page |
/{board}/thread/{no}.rss |
Every post in a thread |
/{board}/archive.rss |
Threads currently in the board archive |
Replace .rss with .atom for Atom 1.0. .xml is accepted as an alias for
.rss.
Architecture
cmd/4chan-rss-bridge/ flag parsing, HTTP server wiring, request logging
internal/fourchan/ typed client for the a.4cdn.org JSON API + TTL cache
internal/markup/ 4chan markup -> sanitised HTML renderer
internal/feed/ RSS 2.0 and Atom 1.0 serialisers
internal/server/ routing, feed assembly, index and OPML pages
The layers are independent: markup and feed have no knowledge of HTTP,
fourchan has no knowledge of feeds, and server composes them.
Markup handling
4chan returns post bodies as HTML fragments. The renderer walks the fragment and re-emits only a whitelist:
<br>,<wbr><s>,<u><pre class="prettyprint"><span class="quote|deadlink|spoiler"><a href="...">withrel="nofollow ugc"
Everything else is dropped, including the closing tag of a dropped element, so
output stays balanced. [spoiler]...[/spoiler] and [code]...[/code] BBCode
that 4chan leaves unexpanded is converted to the equivalent elements.
Links are resolved to absolute URLs. Schemes that can execute code
(javascript:, data:, vbscript:, file:) cause the anchor to be dropped.
Text runs are escaped, but existing entity references such as > and
' are passed through rather than double-escaped, so greentext renders as
> and not as >.
Development
make build # build ./4chan-rss-bridge
make test # go test ./...
make vet # go vet ./...
make fmt # gofmt -l -w .
make run # build and run on 127.0.0.1:8080
make clean # remove build artifacts
Notes and limits
- 4chan prunes threads. A thread feed returns
404once the thread is gone and is not in the archive. - Archived boards are read-only; their catalogs still serve fine.
- The bridge is intended for local use. It has no authentication and no rate
limiting of its own; bind it to
127.0.0.1unless you put a reverse proxy in front of it. - 4chan asks API consumers to be gentle. The default 60-second cache and the reader's own polling interval are usually enough.
License
AGPLv3. See LICENSE.