Repository navigation
PeerPush deals daily via @profullstack/scraper-daemon (1.10.0) - #100
Conversation
peerpush.com/deals lists the discount codes software founders attach to their PeerPush listings, in full. The codes ride in the page's RSC payload (not the JSON-LD), so lib/peerpush-sync.ts decodes the __next_f chunks, brace-matches each product object and maps the ones with a deal to coupons (source 'peerpush', source_id = product id). It reads the default view plus type=big|ending|free (~127 deals on 2026-11-02 vs 50 on the default view) and prunes rows past their valid-until date. Scheduling is the house scraper daemon (lib/daemon.ts): BullMQ on c0upons' own Redis (REDIS_URL), a daily `peerpush` job, run as a role of the web process. A Redis outage stops and rebuilds the daemon instead of exiting the web server. GET /api/v1/daemon serves its status; POST /api/sync/peerpush runs it by hand (1 h throttle); both CLIs' sync and MCP sync_peerpush call it. Also: parseDiscount read "100% off" as 0% (two-digit regex), which hit Reddit rows too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| storeId = await upsertStore(db, row.store); | ||
| storeIds.set(row.store.slug, storeId); | ||
| } | ||
| const existing = await db.sql`SELECT id FROM coupons WHERE source = ${SOURCE} AND source_id = ${row.source_id} LIMIT 1`; |
| WHERE source = ${SOURCE} AND expiry_date IS NOT NULL AND expiry_date <> '' AND expiry_date < ${today} | ||
| AND id NOT IN (SELECT coupon_id FROM bounties WHERE coupon_id IS NOT NULL) | ||
| `; | ||
| for (const r of expired) await db.sql`DELETE FROM coupons WHERE id = ${r.id}`; |
| const r2 = await syncPeerpushDeals(db, { baseUrl: BASE, fetchText, now: () => new Date('2026-11-03T12:00:00Z') }); | ||
| assert.equal(r2.inserted, 0); | ||
| assert.equal(r2.updated, 4); | ||
| const [k] = await db.sql`SELECT code, title FROM coupons WHERE source = 'peerpush' AND source_id = ${ID(1)}`; |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
ThreatCrush Security Scan40 finding(s) MEDIUM: 33 | LOW: 7
Snippets are redacted; ThreatCrush never prints matched credential material. |
Adds peerpush.com/deals as a c0upons source, scheduled daily by the house scraper daemon.
lib/peerpush-sync.ts: decodes the page's RSC payload (codes are not in the JSON-LD), reads/dealsplus?type=big|ending|free, upsertssource='peerpush'coupons per product, prunes expired. Founder text wins over PeerPush's computeddiscountPercent("$20 OFF" arrives as 25%); App Store redeem links give thecode=param.lib/daemon.ts:@profullstack/scraper-daemon0.3.0 on BullMQ,REDIS_URL= c0upons' own compose redis (dev2-site"redis": true). Redis down stops and rebuilds the daemon, never exits the web process.GET /api/v1/daemon,POST /api/sync/peerpush(1 h throttle), CLIsync+ MCPsync_peerpush, /docs.parseDiscountread "100% off" as 0%.Verified:
bun test test91 pass,tsc,next build; built app against a scratch DB + scratch Redis and live peerpush.com: BullMQ engine, 127 deals inserted in 17 s, next run +24 h.🤖 Generated with Claude Code