c0upons.com feeds a coupons collection at /c/coupons - #97
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A
couponscollection 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
dealscollection, so most of its 815 rows are ours already. The adapter keeps only the rows whosesourceis notnichedb: 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 topages(default 10) per run, stops at a short page, dedupes across a page boundary. Onecouponitem 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, andsource:submittedorsource:redditas a tag and in data. Default sourcec0upons-coupons, every fifteen minutes, keyless.packages/core/src/seed.js: thecouponscollection and two feeds,coupons-latestandcoupons-with-codes.coupons.Verified
bun test: 1543 pass across 88 files.test/house-aggregators.test.jscovers registration, the mapping of a submitted and a Reddit row, the skip of anichedb-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).After merge
Railway deploys and the seed creates
c0upons-couponson 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/couponsat once.🤖 Generated with Claude Code
https://claude.ai/code/session_01R63WmerrXfwcHkFRc61J2B