Publisher program (/publishers + zone tiers), chatbot rewritten for LinkSpin, $25 qualification copy fixes

Publisher program (Marty's zone-owner offer for outside site owners):
- /publishers public page: what a zone is, the nine sizes, the waterfall (member ads, network ads, house),
  what pays (viewable only, bots never, warm-up 100 views at 40%, cap), what credits buy, install in four steps
  with the origin lock explained, Standard/Verified tiers, FAQ, and a live "Network right now" strip
- GET /api/public/publishers: zones installed/live, viewable impressions and credits paid in the last 7 days,
  live rates, sizes, warm-up; computed in zones.js and cached a minute
- zones.js: per-zone tier (default standard); verified zones earn network views at nasViewsPerCreditVerified
  (default 8) instead of nasViewsPerCredit (10); member-campaign views stay at viewsPerCredit (5) on both tiers;
  rateFor/tierOf exported; a pay log (zones.json "pay") so credits can be reported by day; publisherTotals(days)
  returns {zones, live, views, viewable, credits, byDay, byZone} with Central day keys for the Reports screen
- admin: Tier select per zone in the Zones pane, saved via POST /api/admin/zones/:id (tier) or the alias
  /api/admin/zones/:id/tier; the admin list carries the 7-day publisher totals
- Zones screen: first-run "Add your site" card (site, size, copy the tag, check it is live) for new accounts and
  for /zones?start=1 from the publisher page; Verified tag on zone rows; rate note mentions the verified rate
- /partners (downline-builder kit) keeps its URL, gets the real LinkSpin ladder ($10 door to $500 Network, $25
  qualifies), the 10% + 10% admin split, and a cross-link to the publisher program

Chatbot: every canned answer and the AI knowledge block now describe LinkSpin (spin links, pages, zones and the
publisher tiers, audiences, promo tools with the five hook angles, blog; the six packages, the 50/20/10/10+10 split,
$25 qualification, pass-ups, the contract; email codes, Control Room screens, sponsor carry-over from the network
registry, free activation). InstantAdPay-only mechanics removed (dormant-lead rescue, Five Dollar Friday, Wired
Wednesday, games, mint passes, surf earn tab); the holding tank stays because /tools > My line still runs it here.

Copy: "Level 2 opens after two of your people buy a $25 or larger package" on the home page, contract, launch,
earning, my, plays pages and promo.js (the $20 figures that remain are the $100 example split amounts).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-10 11:34:42 -05:00
parent 0938e89fbe
commit f63a37947a
18 changed files with 524 additions and 151 deletions
+8 -3
View File
@@ -936,6 +936,10 @@ const server = http.createServer(async (req, res) => {
}
if (p === '/api/zone/seen' && (req.method === 'GET' || req.method === 'POST')) { await zones.seen(u.searchParams.get('i'), req); res.writeHead(204, corsCreds(req)); return res.end(); }
{ const zm = /^\/api\/zone\/click\/([a-f0-9]{12})$/.exec(p); if (zm && req.method === 'GET') { const target = await zones.click(zm[1]); res.writeHead(302, { Location: target || '/', 'Cache-Control': 'no-store', 'Referrer-Policy': 'no-referrer-when-downgrade' }); return res.end(); } }
// -- publisher program (2026-10-10): the public offer for site owners who carry zones, and its live "Network right now"
// strip (7-day totals from zones.js, cached a minute). App host only; the link and pages domains stay single-purpose.
if (p === '/api/public/publishers' && req.method === 'GET') return json(res, 200, zones.publisherPublic(), { 'Cache-Control': 'public, max-age=60' });
if (p === '/publishers' && (req.method === 'GET' || req.method === 'HEAD') && !isPagesHost(req) && !isLinkHost(req)) return sendFile(res, path.join(PUBLIC_DIR, 'publishers.html'));
{ const wm = /^\/welcome\/([a-f0-9]{48})$/.exec(p); if (wm && (req.method === 'GET' || req.method === 'POST')) { // one-time tester sign-in link
const t = inviteTokens.get(wm[1]);
if (!t || t.exp < Date.now()) { inviteTokens.delete(wm[1]); res.writeHead(410, { 'Content-Type': 'text/html; charset=utf-8' }); return res.end('<!doctype html><meta charset="utf-8"><title>Link used</title><p style="font:15px system-ui;padding:24px">That sign-in link was already used or has expired. Ask for a fresh one.</p>'); }
@@ -1952,7 +1956,7 @@ const server = http.createServer(async (req, res) => {
}
if (p === '/api/my/zones' && req.method === 'GET') {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
return json(res, 200, { zones: await zones.list(s.email), host: SITE_HOST, sizes: Object.keys(zones.SIZES), rates: zones.settings() }, { 'Cache-Control': 'no-store' });
return json(res, 200, { zones: await zones.list(s.email), host: SITE_HOST, sizes: Object.keys(zones.SIZES), networkSizes: Array.from(zones.NAS_SIZES), tiers: zones.TIERS, rates: zones.settings(), warmup: zones.WARMUP, holdRatio: zones.HOLD_RATIO }, { 'Cache-Control': 'no-store' });
}
if (p === '/api/my/zones' && req.method === 'POST') {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
@@ -1976,9 +1980,10 @@ const server = http.createServer(async (req, res) => {
}
if (p === '/api/admin/zones' && req.method === 'GET') {
if (!isAdmin(req)) return json(res, 401, { error: 'Admin only.' });
return json(res, 200, { zones: await zones.adminList(), totals: zones.totals(), rates: zones.settings(), warmup: zones.WARMUP, holdRatio: zones.HOLD_RATIO }, { 'Cache-Control': 'no-store' });
return json(res, 200, { zones: await zones.adminList(), totals: zones.totals(), publishers: zones.publisherTotals(7), rates: zones.settings(), tiers: zones.TIERS, warmup: zones.WARMUP, holdRatio: zones.HOLD_RATIO }, { 'Cache-Control': 'no-store' });
}
m = /^\/api\/admin\/zones\/(ls-[a-f0-9]{6})$/.exec(p);
// admin: pause/resume, note, and the publisher tier ({ tier: 'standard' | 'verified' }; /tier is an alias for the same update)
m = /^\/api\/admin\/zones\/(ls-[a-f0-9]{6})(\/tier)?$/.exec(p);
if (m && req.method === 'POST') {
if (!isAdmin(req)) return json(res, 401, { error: 'Admin only.' });
const r = await zones.adminSet(m[1], await readBody(req)); return json(res, r.error ? 400 : 200, r);