Skip to content

c0upons.com feeds a coupons collection at /c/coupons - #97

Merged
ralyodio merged 1 commit into
mainfrom
worktree-c0upons-adapter
Sep 13, 2026
Merged

ralyodio merged 1 commit into
mainfrom
worktree-c0upons-adapter

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

A coupons collection at /c/coupons, filled by a ninth house adapter, c0upons, that reads c0upons.com's public /api/coupons.

Why not everything c0upons has

c0upons fills itself from this database's deals collection, so most of its 815 rows are ours already. The adapter keeps only the rows whose source is not nichedb: codes people submitted on the site, and the listings c0upons reads from r/couponcodes every five minutes (c0upons PR #59). A live pull today: 22 coupons of 815 read, 793 already ours, 21 from Reddit and 1 submitted.

How

  • packages/adapters/src/c0upons.js: offset walk, 200 a page, up to pages (default 10) per run, stops at a short page, dedupes across a page boundary. One coupon item per row: title, description, coupon page as the URL, store key and name, store domain read off the favicon URL c0upons built from it, code, discount type and value, expiry, deal URL, votes, and source:submitted or source:reddit as a tag and in data. Default source c0upons-coupons, every fifteen minutes, keyless.
  • packages/core/src/seed.js: the coupons collection and two feeds, coupons-latest and coupons-with-codes.
  • Registered in the adapter index under the house aggregators; README collection and house-aggregator tables updated; the registry test's collection list gains coupons.

Verified

  • bun test: 1543 pass across 88 files. test/house-aggregators.test.js covers registration, the mapping of a submitted and a Reddit row, the skip of a nichedb-sourced row, the domain from the favicon, the page walk with its log line, and the short-page stop.
  • bun run lint: clean (the 10 warnings are pre-existing).
  • Live pull against c0upons.com through the adapter with a real fetch, as above.

After merge

Railway deploys and the seed creates c0upons-coupons on boot. A new source queues behind every older one that is due at the same moment, so the first run may take a while; running it directly inside the container (runSource) fills /c/coupons at once.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R63WmerrXfwcHkFRc61J2B

c0upons fills itself from this database's deals collection, and since
1.7.0 also from r/couponcodes and from what people submit on the site.
Those last two never reached nichedb. This adds the ninth house adapter,
`c0upons`, and a `coupons` collection for what it brings.

packages/adapters/src/c0upons.js walks c0upons' keyless `/api/coupons`
(offset paged, 200 a page, store joined in) and keeps every row whose
`source` is not `nichedb`: a copy of our own deals row would only double
it, so those are counted and left where they already are. Each kept row
becomes a `coupon` item under its store key with the code, discount type
and value, expiry, deal URL, votes and origin (`submitted` or `reddit`)
as data, the store domain read off the favicon URL c0upons built from it,
and the coupon page as the URL. The default source is `c0upons-coupons`,
every fifteen minutes.

Seeded feeds: `coupons-latest` and `coupons-with-codes`. README tables
and the registry test's collection list updated.

Verified: 1543 tests pass (test/house-aggregators.test.js covers the
mapping, the skip of our own rows, the domain from the favicon, the page
walk and the short-page stop), biome clean, and a live pull against
c0upons.com returned 22 coupons of 815 read, 793 already ours.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R63WmerrXfwcHkFRc61J2B
@ralyodio
ralyodio merged commit 5256c62 into main Sep 13, 2026
3 checks passed
@ralyodio
ralyodio deleted the worktree-c0upons-adapter branch September 13, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant