Site host from one module: host.js exports SITE_HOST/SITE_URL and every module, email, Telegram post, QR, ad click URL and OG tag reads it (no more hard-coded test hostname); public pages carry {{SITE_URL}} filled at serve time; frame check carries the curtain pass for our own hosts so a test ad can point at a spin link; stale IAP sitemap removed

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-07 08:52:04 -05:00
parent 6da444c790
commit ad744d8c0f
29 changed files with 135 additions and 111 deletions
+5 -4
View File
@@ -4,6 +4,7 @@
// allowance by tier, then costs ad credits from the member's earned pool (credits are advertising, 1 = 1 cent).
// The engine is the same OpenRouter model the chatbot uses; the LinkSpin facts, the compliance rules and
// the voice live here in version control and travel with every request.
const { SITE_HOST, SITE_URL } = require('./host');
const fs = require('fs');
const path = require('path');
const https = require('https');
@@ -47,7 +48,7 @@ const COMPLIANCE = [
'Payments are POL on Polygon, wallet to wallet, on a public ledger anyone can check. Cryptocurrency carries real risk; results depend on effort.',
'No em dashes and no double hyphens anywhere. No fake urgency, no fake scarcity, no invented testimonials.'
].join(' ');
const FACTS = 'LinkSpin (linkspin-test.saasy.top) is an advertising platform: members join free by email, earn ad credits daily by viewing a short set of ads (the claim grows with a streak), and spend credits on their own banner, text, login, solo, video, featured and verified-visit campaigns across the site and a partner network; views are timed on the server so a real person saw the ad. Ad packages from $5 buy more reach. Every package sold pays the sponsor instantly on-chain in the same transaction; there is no balance to withdraw because nothing is held. The daily routine members are taught: do the five-ad set and spend the claim, message one person in your line, check the holding tank, have one conversation with someone who already pays for traffic. Two qualifying buyers open the next level; five open the one after. Founder: Marty Bostick; brought to you by the Crypto Team Build Network.';
const FACTS = 'LinkSpin (' + SITE_HOST + ') is an advertising platform: members join free by email, earn ad credits daily by viewing a short set of ads (the claim grows with a streak), and spend credits on their own banner, text, login, solo, video, featured and verified-visit campaigns across the site and a partner network; views are timed on the server so a real person saw the ad. Ad packages from $5 buy more reach. Every package sold pays the sponsor instantly on-chain in the same transaction; there is no balance to withdraw because nothing is held. The daily routine members are taught: do the five-ad set and spend the claim, message one person in your line, check the holding tank, have one conversation with someone who already pays for traffic. Two qualifying buyers open the next level; five open the one after. Founder: Marty Bostick; brought to you by the Crypto Team Build Network.';
const VOICE = 'Write like a straight-talking internet marketer who has been around long enough to hate hype: plain words, short sentences, honest about risk, warm and confident, never salesy. First person, as the member. Specific beats clever.';
const KINDS = {
post: { label: 'Social post', shape: 'Write ONE social media post of 40-90 words. Strong first line. No hashtags. At most one emoji. End with a soft invitation to look, not a hard sell, and put the link on its own last line.' },
@@ -92,9 +93,9 @@ async function status(email) {
const u = usage()[email] || {}; const used = (u.months || {})[monthKey()] || 0;
const allowance = allowanceFor(tier, sc); const cost = Number(sc.aiCreditsPerGen) || 10;
let available = 0; try { const st = await R.ads.viewStatus(email); available = st.earnedAvailable != null ? st.earnedAvailable : (st.earned || 0); } catch (e) {}
const link = 'https://linkspin-test.saasy.top/join/' + (acct.username || acct.code);
const link = SITE_URL + '/join/' + (acct.username || acct.code);
const partner = tier === 'nexus' ? await partnerStatus(email) : null;
const handoutUrl = rank[tier] >= rank.spark && acct.username ? 'https://linkspin-test.saasy.top/handout/' + acct.username : null;
const handoutUrl = rank[tier] >= rank.spark && acct.username ? SITE_URL + '/handout/' + acct.username : null;
return { tier, badges, username: acct.username || null, partner, handoutUrl, videoMaker: !!(R.videomaker && R.videomaker.available()), unlocked: ['surge', 'circuit', 'nexus'].includes(tier), engine: !!key(), allowance, used, freeLeft: Math.max(0, allowance - used), cost, available, link,
kinds: Object.entries(KINDS).map(([k, v]) => ({ key: k, label: v.label })), angles: Object.keys(ANGLES),
tiers: TIERS.map(t => ({ key: t.key, name: t.name, needText: t.needText || '', blurb: t.blurb, items: t.items, reached: t.key === 'free' || badges.includes(t.need) })),
@@ -128,7 +129,7 @@ async function adminUsage() {
}
// ---- the rest of the ladder (Marty, 2026-09-14): Spark templates + handout, Circuit split tester + Video
// Maker, Nexus Leader Ops + team grants + a member-funded partner code ----
const KIT = 'https://linkspin-test.saasy.top';
const KIT = SITE_URL;
async function tierOf(email) { return tierFor(await R.ads.milestonesOf(email)); }
const rank = { free: 0, spark: 1, surge: 2, circuit: 3, nexus: 4 };
const atLeast = (tier, need) => rank[tier] >= rank[need];