Tool tiers for spin links and pages (Marty): Free 3, Starter (any own package) 10, Builder (2 qualifying buyers) 50, Leader (5) unlimited with a 500 fair-use ceiling; existing items above a cap are kept, only new ones wait; Links/Pages headers show N of M (tier); chatbot facts + KNOWLEDGE_DATE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-21 06:58:16 -05:00
parent 33f3b9d337
commit a0daf7925a
6 changed files with 37 additions and 7 deletions
+2 -1
View File
@@ -25,7 +25,7 @@ let DATA_DIR = null;
let chain = null;
const MODEL = process.env.OPENROUTER_MODEL || 'deepseek/deepseek-v4-flash:nitro';
const CONTRACT = '0x26Bdc556b94399bEdd69ae3ACA5aA6c54D946e8b';
const KNOWLEDGE_DATE = '2026-10-20'; // the day the CANNED answers and FACTS below were last checked against the site
const KNOWLEDGE_DATE = '2026-10-21'; // the day the CANNED answers and FACTS below were last checked against the site
function init(opts) { DATA_DIR = opts.dataDir; chain = opts.chain; return kb.init({ dataDir: DATA_DIR, seeds: seeds() }); }
function key() {
@@ -146,6 +146,7 @@ function systemPrompt(kbBlock) {
FACTS:
- PRODUCT, all free with an email account: SPIN LINKS (the rotator: one short link, /r/<code>, rotates between destinations by weight; pause any destination; a fallback for when all are off; one-hop redirect; every click recorded with day, country, source, device and a daily-salted visitor hash; bots filtered on the server; click ids and sub ids such as clickid, subid, s1 to s4 pass through to the destination; split tests by tagging the same link with different sub ids; a demo spin on the home page needs no account; DAYPARTING is live: a 7x24 hours grid per spin and per destination, time zone by name or the local time of the visitor, presets, and 'my best hours' from the clicks of the member after 200 clicks; automatic HEALTH CHECKS are live: every destination is checked every 30 minutes, a dead or parked one is paused after three failing checks and resumed when it passes twice, the owner is told once, and Check now runs it on demand). PAGES (page builder: scan any offer URL, get a bridge, review or squeeze page; designs, palettes, layouts and niche presets with hero images; leads to the member's own list, CSV or webhook; published on the pages domain lookfirst.page; sales, advertorial and press-release layouts are coming). ZONES (an ad slot on the member's own site: one async script tag, nine sizes 728x90, 468x60, 300x250, 336x280, 250x250, 125x125, 160x600, 120x600, 320x50; waterfall = LinkSpin member campaign, then a network ad for 728x90 and 468x60, then the LinkSpin house banner; pays ad credits per VIEWABLE impression, half the banner on screen for one second, bots never, 50 credited views per visitor per zone per day; rates 1 credit per 5 viewable member-ad views and 1 per 10 network-ad views, 1 per 8 on a Verified zone; warm-up: a zone earns after its first 100 on-site views with at least 40 percent viewable and goes on hold below that; origin lock: paid ads serve only on the declared site and its subdomains, elsewhere the house banner shows and nothing is earned; up to 50 zones per account; PUBLISHER PROGRAM at /publishers for site owners, tiers Standard (default) and Verified (admin-reviewed site, better network rate)). AUDIENCES (first-party retargeting: "My visitors" collects everyone who viewed the member's pages and zones for 30 days; a pixel tag /p.js for other sites; campaigns can "show only to" or "never show to" an audience; nothing personal stored). PROMO TOOLS at /tools#promo (social posts, text-a-friend, email swipes, banners, objection bank, hook videos; five hook angles with videos: links, pages, zones, audiences, stack; angle links are the invite link plus ?v=). REPORTS (every link in one view, plus Pages, Zones, and since 2026-10-12 Traffic sources and Placements). BLOG at /blog with RSS at /blog/feed.xml. TRAFFIC SOURCES at /sources (2026-10-12): a source is a record of a network the member buys traffic on, created from a catalog of networks (PropellerAds, Zeropark, Adsterra, ExoClick, HilltopAds, TrafficStars, PopAds and more, with each network's macro tokens and conversion postback URL; account-specific slots such as a goal id are filled in at creation) or defined by hand; a spin link is pointed at one source (Share kit on the Links screen, or the Sources screen), and then the Share kit's first row is the exact campaign URL for that network with its macros already in place; when a click that came through that source converts (join, lead, wallet, purchase, or a partner-reported conversion; the member picks which) LinkSpin fires that network's own postback with the network's click id and the payout, server to server, and only the network that sent the click is told; Reports show clicks, uniques and conversions by source and by placement (the value the network's zone, placement, site, campaign, creative, banner or keyword macro carried); up to 30 sources per account, 20 params each; a source with no postback still builds the campaign URL and shows in Reports; the account-level Postbacks list on the Links screen (for the member's own tracker) still works alongside. Knowledge checked on ${KNOWLEDGE_DATE}.
- TOOL LIMITS BY TIER (2026-10-21): spin links and pages each: Free (no package) 3, Starter (any package of your own) 10, Builder (level 2 open, 2 qualifying buyers) 50, Leader (level 3 open, 5 qualifying buyers) unlimited (fair use). Each spin link rotates up to 25 destinations at every tier; clicks are unlimited. Nothing already made is ever removed when a cap applies; new ones wait for the upgrade. Banner Spin has its own ladder (Starter 2 x 5, Builder 5 x 15, Leader 10 x 25). Other limits, same for everyone: 50 zones, 20 audiences, 20 postbacks, 5 linked positions.
- BANNER SPIN (LIVE 2026-10-18, reports and health checks 2026-10-20): one image address (/i/<code>.gif on a link domain) and one click address (/c/<code>) that rotate up to 25 banners, each with its own target (any https page or one of the member's spin links), weights 1 to 100, random by weight on every view or one banner per visitor per day, the dayparting grid per Banner Spin and per banner, pause, a fallback page and an optional fallback banner image, and a traffic source so its conversions fire that network's postback. Built on the Links screen (${SITE_URL}/links#b). WHO GETS IT: a free add-on for members with their own package of $25 or more; tiers: Starter 2 Banner Spins x 5 banners, Builder (level 2 open, 2 qualifying buyers) 5 x 15, Leader (level 3 open, 5 qualifying buyers) 10 x 25; dropping below a tier keeps everything serving, it only stops new ones. One size per Banner Spin (468x60, 728x90, 300x250, 125x125, 160x600, 120x600, 336x280, 250x250, 320x50); JPG, PNG or GIF (animated is fine), 150 KB at most, uploads count toward the 10 files a day. EMBEDS: the image + click pair (traffic exchanges, safelists, downline builders), an HTML snippet (own sites, blogs, HTML email), a script tag (writes the banner and its own link, so every click matches exactly) and forum BBCode; every link domain answers every code. MATCHING: with the pair, the server remembers which banner a visitor saw on which page for 15 minutes and sends the click there; an unmatched click goes to the fallback. LIMITS: paid ad networks (Froggy, PropellerAds and the like) copy the image at upload, so it freezes on one banner there; Gmail and some mail apps fetch images through a caching proxy, so email readers mostly see one banner and clicks fall back: use a single-banner Banner Spin for email. REPORTS: per banner and per placement views, unique viewers (daily sample), clicks, CTR, match rate and conversions, by Central day, country and device, bots and server loads shown separately and never counted; a WINNER badge once two or more live banners have 1,000 views each and one leads on click rate (LinkSpin never changes weights by itself); a CACHED flag on a placement that copies banners to its own server; totals also on the Reports screen. HEALTH: every 30 minutes each live banner's image must load as an image of the right size and its target must pass the spin-link checks (dead, parked, slow); three failures in a row pause that banner, two clean passes resume it, the last live banner is never auto-paused, and the status shows on each banner row.
- PACKAGES (priced in dollars, settled in POL at the live rate, 1 credit = 1 cent of ad delivery): $10 door = 1,000 credits, for trying the ads, does NOT count toward qualification; $25 Starter = 2,500; $50 Builder = 5,000; $100 Growth = 10,000; $250 Leader = 25,000; $500 Network = 50,000. Any package of $25 or more makes the buyer a qualifying buyer for their sponsor.
- THE SPLIT, same transaction on Polygon, fixed in the contract: 50 percent direct sponsor, 20 percent level 2, 10 percent level 3, 10 percent + 10 percent to the two admin wallets. Level 1 pays from a referral's first qualifying purchase once the sponsor's payouts are on. Level 2 opens after two of the member's people buy a qualifying ($25 or larger) package, level 3 after five. An unfilled tier passes up the line to the next qualified member, then to the platform. Nothing is held, there are no withdrawals, no pending balances. Contract ${CONTRACT} on Polygon, verified on Polygonscan; plain-language review at ${SITE_URL}/contract; live ledger at ${SITE_URL}/ledger with a verify link on every row.
+2 -1
View File
@@ -75,7 +75,8 @@
try { const lh = await api('/api/my/link-hosts'); LH = (lh && lh.hosts) || []; } catch (e) { LH = []; } // link domains by channel (domains.js, 2026-10-10)
try { SRC = (await CR.get('/api/my/sources')).sources || []; } catch (e) { SRC = []; }
const tot7 = ROT.reduce((n, x) => n + clicks7(x), 0);
if (!/^#b/.test(location.hash)) CR.sub(ROT.length + ' link' + (ROT.length === 1 ? '' : 's') + ' · ' + fmt(tot7) + ' clicks in 7 days');
const TT = r.tier; const capTxt = TT ? (TT.unlimited ? ' links (' + TT.label + ', unlimited)' : ' of ' + TT.max + ' links (' + TT.label + ')') : (' link' + (ROT.length === 1 ? '' : 's'));
if (!/^#b/.test(location.hash)) CR.sub(ROT.length + capTxt + ' · ' + fmt(tot7) + ' clicks in 7 days');
renderList();
if (/^#b/.test(location.hash)) { renderList(); return; } // the Banner Spin view owns the page (banner-spin.js)
const want = SEL != null ? SEL : (Number(location.hash.slice(1)) || null);
+2 -1
View File
@@ -45,7 +45,8 @@
let r; try { r = await CR.get('/api/my/pages'); } catch (e) { CR.sub('could not load'); return; }
PAGES = r.pages || []; HOSTS = r.hosts || []; BASE = r.pageBase || ''; if (r.styles) STYLES = r.styles; PROVIDERS = r.providers || []; IMAGES = r.images || []; if (r.imageMax) IMG_MAX = r.imageMax; if (r.imageBytes) IMG_BYTES = r.imageBytes;
const pubd = PAGES.filter(p => p.status === 'published').length;
CR.sub(PAGES.length + ' page' + (PAGES.length === 1 ? '' : 's') + ' · ' + pubd + ' live');
const TT = r.tier; const capTxt = TT ? (TT.unlimited ? ' pages (' + TT.label + ', unlimited)' : ' of ' + TT.max + ' pages (' + TT.label + ')') : (' page' + (PAGES.length === 1 ? '' : 's'));
CR.sub(PAGES.length + capTxt + ' · ' + pubd + ' live');
const views = PAGES.reduce((n, p) => n + p.views, 0), leads = PAGES.reduce((n, p) => n + p.leads, 0), clicks = PAGES.reduce((n, p) => n + p.clicks, 0);
$('tiles').innerHTML = [['Pages', fmt(PAGES.length)], ['Live', fmt(pubd)], ['Views', fmt(views)], ['Clicks through', fmt(clicks)], ['Leads on your list', fmt(leads)]].map(([k, v], i) => '<div class="tile' + (i === 4 ? ' hi' : '') + '"><span class="k">' + k + '</span><span class="v">' + v + '</span></div>').join('');
$('gal').innerHTML = PAGES.length ? PAGES.map(p => '<div class="card' + (p.id === SEL ? ' on' : '') + '" data-id="' + p.id + '" role="button" tabindex="0"><div class="thumb"><i class="t"></i><i style="width:55%"></i><i style="width:65%"></i><i class="b"></i></div><div class="cap"><b>' + esc(p.title) + '</b><span class="mono muted" style="font-size:11px">' + p.type + ' · ' + (p.status === 'published' ? '<span class="ok">live</span>' : 'draft') + ' · ' + fmt(p.views) + ' views' + (p.leads ? ' · ' + fmt(p.leads) + ' leads' : '') + '</span></div></div>').join('')
+1 -1
View File
@@ -241,7 +241,7 @@
</div>
</div>
<script src="/assets/cr-shell.js?v=20261018c"></script>
<script src="/assets/links.js?v=20261018bs"></script>
<script src="/assets/links.js?v=20261021t"></script>
<script src="/assets/banner-spin.js?v=20261020bs3"></script>
</body>
</html>
+1 -1
View File
@@ -73,6 +73,6 @@
</div>
</div>
<script src="/assets/cr-shell.js?v=20261018c"></script>
<script src="/assets/pages-screen.js?v=20261011a"></script>
<script src="/assets/pages-screen.js?v=20261021t"></script>
</body>
</html>
+29 -2
View File
@@ -190,6 +190,31 @@ async function bannerFacts(email) {
try { const ms = await ads.milestonesOf(e); if (ms.includes('level3')) buyers = Math.max(buyers, 5); else if (ms.includes('level2')) buyers = Math.max(buyers, 2); } catch (er) {} // a badge once earned stays earned
const f = { ownBuy, buyers }; bsFacts.set(e, { ts: Date.now(), f }); return f;
}
// Tool tiers for spin links and pages (Marty 2026-10-21: "cap this ... and there needs to be more of an incentive for
// upgrading"): free 3, Starter (any package of your own) 10, Builder (2 qualifying buyers) 50, Leader (5) unlimited with a
// fair-use ceiling. Existing items above a cap are never removed; only new ones wait for the upgrade.
const TOOL_TIERS = { free: { label: 'Free', max: 3, need: '' }, starter: { label: 'Starter', max: 10, need: 'any package of your own' },
builder: { label: 'Builder', max: 50, need: 'level 2 open (2 qualifying buyers)' }, leader: { label: 'Leader', max: 500, unlimited: true, need: 'level 3 open (5 qualifying buyers)' } };
const TOOL_ORDER = ['free', 'starter', 'builder', 'leader'];
const toolCache = new Map();
async function toolTier(email) {
const e = String(email || '').toLowerCase(); const hit = toolCache.get(e); if (hit && Date.now() - hit.ts < 60000) return hit.t;
let key = 'free';
if (ADMIN_EMAIL && e === ADMIN_EMAIL) key = 'leader';
else {
const ids = []; try { const a = await accounts.byEmail(e); if (a && a.memberId) ids.push(a.memberId); for (const pz of await accounts.positions(e)) if (pz.memberId && !ids.includes(pz.memberId)) ids.push(pz.memberId); } catch (er) {}
let paid = false; if (ids.length) { const idset = new Set(ids); for (const ev of chain.recentEvents(200000)) if (ev.type === 'Purchase' && idset.has(ev.buyerId)) { paid = true; break; } }
let buyers = 0; try { buyers = (await bannerFacts(e)).buyers || 0; } catch (er) {}
key = buyers >= 5 ? 'leader' : buyers >= 2 ? 'builder' : paid ? 'starter' : 'free';
}
const t = TOOL_TIERS[key], nk = TOOL_ORDER[TOOL_ORDER.indexOf(key) + 1], n = nk ? TOOL_TIERS[nk] : null;
const out = { key, label: t.label, max: t.max, unlimited: !!t.unlimited, next: n ? { key: nk, label: n.label, max: n.max, unlimited: !!n.unlimited, need: n.need } : null };
toolCache.set(e, { ts: Date.now(), t: out }); return out;
}
function toolCapError(kind, have, t) {
const nx = t.next ? ' ' + t.next.label + ' (' + t.next.need + ') ' + (t.next.unlimited ? 'makes them unlimited.' : 'holds ' + t.next.max + '.') : '';
return 'Your ' + t.label + ' tier holds ' + t.max + ' ' + kind + ' and you have ' + have + '.' + nx;
}
async function myMemberIds(s) {
const main = await auth.refreshMemberId(s);
const ids = main ? [main] : [];
@@ -2244,10 +2269,11 @@ const server = http.createServer(async (req, res) => {
if (p === '/api/my/rotations' && req.method === 'GET') {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
const sc = siteConfig(); const hosts = String(sc.linkDomains || '').split(',').map(x => x.trim()).filter(Boolean);
return json(res, 200, { rotations: await rotator.list(s.email), hosts: hosts.length ? hosts : [SITE_HOST] }, { 'Cache-Control': 'no-store' });
return json(res, 200, { rotations: await rotator.list(s.email), hosts: hosts.length ? hosts : [SITE_HOST], tier: await toolTier(s.email) }, { 'Cache-Control': 'no-store' });
}
if (p === '/api/my/rotations' && req.method === 'POST') {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
{ const t = await toolTier(s.email); const have = (await rotator.list(s.email)).length; if (have >= t.max) return json(res, 400, { error: toolCapError('spin links', have, t), tier: t }); }
const r = await rotator.create(s.email, await readBody(req)); return json(res, r.error ? 400 : 200, r);
}
m = /^\/api\/my\/rotations\/(\d+)$/.exec(p);
@@ -2395,7 +2421,7 @@ const server = http.createServer(async (req, res) => {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
const hosts = domains.live(); // burned or reserve domains are never handed out for new pages
const ph = pagesHost(); const pageBase = ph ? 'https://' + ph + '/' : 'https://' + (hosts[0] || SITE_HOST) + '/p/';
return json(res, 200, { pages: await pages.list(s.email), hosts: ph ? [ph] : (hosts.length ? hosts : [SITE_HOST]), pageBase, types: pages.TYPES, styles: require('./pagestyle').catalog(), providers: pages.providers(), images: await pages.images(s.email), imageMax: pages.IMG_MAX, imageBytes: pages.IMG_BYTES }, { 'Cache-Control': 'no-store' });
return json(res, 200, { pages: await pages.list(s.email), hosts: ph ? [ph] : (hosts.length ? hosts : [SITE_HOST]), pageBase, types: pages.TYPES, styles: require('./pagestyle').catalog(), providers: pages.providers(), images: await pages.images(s.email), imageMax: pages.IMG_MAX, imageBytes: pages.IMG_BYTES , tier: await toolTier(s.email) }, { 'Cache-Control': 'no-store' });
}
if (p === '/api/my/pages/upload' && req.method === 'POST') {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
@@ -2425,6 +2451,7 @@ const server = http.createServer(async (req, res) => {
}
if (p === '/api/my/pages' && req.method === 'POST') {
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
{ const t = await toolTier(s.email); const have = (await pages.list(s.email)).length; if (have >= t.max) return json(res, 400, { error: toolCapError('pages', have, t), tier: t }); }
const r = await pages.create(s.email, await readBody(req)); return json(res, r.error ? 400 : 200, r);
}
if (p === '/api/my/pages/scan' && req.method === 'POST') {