diff --git a/blog.js b/blog.js index bedb9f1..fdd97c7 100644 --- a/blog.js +++ b/blog.js @@ -110,7 +110,7 @@ function head(o) { + '
'; } function tail() { - return '
'; + return ''; } const authorBox = () => '
InstantAdPay
' + AUTHOR + 'Founder of InstantAdPay and the Crypto Team Build Network. Twenty-plus years of internet marketing, and a habit of writing down what actually worked.
'; const cardHtml = p => '' + (p.cover ? '' : '') + '

' + esc(p.title) + '

' + esc(p.excerpt) + '

' + fmtDate(p.publishedAt || p.created) + ' · ' + readMinutes(p.body) + ' min read' + (p.tags.length ? ' · ' + p.tags.map(esc).join(', ') : '') + '

'; diff --git a/leaderboard.js b/leaderboard.js index e136c33..5bea2b3 100644 --- a/leaderboard.js +++ b/leaderboard.js @@ -142,7 +142,7 @@ async function renderPage() { const w = winners(); if (w.length) h += '

Past winners

' + w.slice(0, 12).map(x => '
' + (x.kind === 'week' ? 'Week of ' : 'Month of ') + fmtD(x.start) + ': ' + (x.top[0] ? esc(x.top[0].name) + ' (' + x.top[0].sales + ' sold, $' + x.top[0].usd + ')' : 'no sales') + (x.granted && x.granted.length ? ' · awarded: ' + x.granted.map(g => esc(g.name) + ' +' + g.credits.toLocaleString()).join(', ') : (x.prize ? ' · prize ' + esc(x.prize) : '')) + '
').join(''); h += '

Sales are $ of packages bought by members you directly sponsor. Prizes are advertising credits or packages, never cash. No income is guaranteed.

'; - h += ''; + h += ''; return h; } module.exports = { init, view, compute, renderPage, rolloverTick, winners, periodBounds }; diff --git a/netsites.js b/netsites.js new file mode 100644 index 0000000..2536f92 --- /dev/null +++ b/netsites.js @@ -0,0 +1,40 @@ +// The network sites list for the footer's "Part of the network" line (Marty 2026-11-14 trust pack). +// One source: the hub's public GET /v1/network-sites (HUB_URL). Cached 10 minutes, refreshed in the background, never waits on a +// slow hub (2.5 s timeout), and falls back to the same built-in list. Never RM Circle, never the games. +// The same file lives in every network site (InstantAdPay, LinkSpin, Downline Banners, VBB, Stack POL). +const FALLBACK = [ + { id: 'iap', name: 'InstantAdPay', url: 'https://instantadpay.com' }, + { id: 'linkspin', name: 'LinkSpin', url: 'https://linkspin.app' }, + { id: 'dlb', name: 'Downline Banners', url: 'https://downlinebanners.com' }, + { id: 'vbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com' }, + { id: 'stackpol', name: 'Stack POL', url: 'https://stackpol.com' }, + { id: 'earnerscorner', name: 'Earners Corner', url: 'https://earnerscorner.com' } +]; +const TTL = 10 * 60 * 1000; +let cache = { at: 0, list: FALLBACK, from: 'fallback' }; +let inflight = null; + +const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, ''); +function clean(list) { + if (!Array.isArray(list)) return null; + const ok = list.filter(s => s && typeof s.name === 'string' && /^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(s.url || ''))) + .slice(0, 30).map(s => ({ id: String(s.id || s.name).toLowerCase().replace(/[^a-z0-9]+/g, '').slice(0, 30), name: String(s.name).slice(0, 60), url: String(s.url).replace(/\/+$/, '') })); + return ok.length ? ok : null; +} +function refresh() { + if (inflight || process.env.NETWORK_SITES_HUB === '0') return inflight; + const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500); + inflight = fetch(hubUrl() + '/v1/network-sites', { signal: ac.signal }) + .then(r => (r.ok ? r.json() : null)) + .then(j => { const l = clean(j); if (l) cache = { at: Date.now(), list: l, from: 'hub' }; else cache.at = Date.now(); }) + .catch(() => { cache.at = Date.now() - TTL + 60 * 1000; }) // hub down: try again in a minute, keep the last good list + .finally(() => { clearTimeout(t); inflight = null; }); + return inflight; +} +function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list; } +// GET /api/network-sites: public, cacheable, the same answer on every page +function handle(req, res) { + res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=300', 'X-Content-Type-Options': 'nosniff' }); + res.end(JSON.stringify(list())); +} +module.exports = { list, handle, refresh, FALLBACK, _state: () => cache }; diff --git a/public/admin.html b/public/admin.html index ebd5d8d..05a9469 100644 --- a/public/admin.html +++ b/public/admin.html @@ -652,7 +652,7 @@ - + diff --git a/public/assets/common.js b/public/assets/common.js index fe8c214..1041f6b 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -57,9 +57,36 @@ window.IAP = (function () { f.innerHTML = '
© ' + new Date().getFullYear() + ' InstantAdPay
' + '
' + 'How it worksPresentationLive ledgerThe contractBlogLeaderboardWhat\'s new' - + 'Platform factsSupportTermsPrivacyDisclaimer
'; + + 'Platform factsSupportTermsEarnings DisclaimerPrivacy' + + '
TrustClickz · 615 Green Valley Drive, Moody, AL 35004
'; document.body.appendChild(f); + renderNetworkLine(f); } + // "Part of the network" (Marty 2026-11-14 trust pack): the list comes from the hub through /api/network-sites, built-in copy if not + const NET_FALLBACK = [['iap', 'InstantAdPay', 'https://instantadpay.com'], ['linkspin', 'LinkSpin', 'https://linkspin.app'], ['dlb', 'Downline Banners', 'https://downlinebanners.com'], + ['vbb', 'Viral Banner Blitz', 'https://viralbannerblitz.com'], ['stackpol', 'Stack POL', 'https://stackpol.com'], ['earnerscorner', 'Earners Corner', 'https://earnerscorner.com']].map(a => ({ id: a[0], name: a[1], url: a[2] })); + let netList = null; + async function networkSites() { + if (!netList) netList = fetch('/api/network-sites').then(r => r.json()).then(l => (Array.isArray(l) && l.length ? l : NET_FALLBACK)).catch(() => NET_FALLBACK); + return netList; + } + function renderNetworkLine(host) { + if (!host || host.querySelector('.netline')) return; + const d = document.createElement('div'); d.className = 'netline'; + d.style.cssText = 'margin-top:10px;display:flex;gap:6px 14px;justify-content:center;flex-wrap:wrap;align-items:baseline;font-size:12.5px'; + host.appendChild(d); + const esc = s => String(s).replace(/[&<>"]/g, ch => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[ch]); + const paint = list => { + d.innerHTML = 'Part of the networkOne account across the network:' + list.map(s => (s.id === 'iap' || /instantadpay\.com/.test(s.url)) + ? '' + esc(s.name) + ' (you are here)' + : '' + esc(s.name) + '').join(''); + }; + paint(NET_FALLBACK); + networkSites().then(paint); + } + // pages with their own footer (the members area) get the network line too + function decorateFooters() { document.querySelectorAll('footer.bo-pagefoot').forEach(f => { const w = document.createElement('div'); w.style.width = '100%'; f.appendChild(w); renderNetworkLine(w); }); } + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', decorateFooters); else decorateFooters(); async function refreshNavWallet() { try { const me = await (await fetch('/api/me')).json(); diff --git a/public/bixpay.html b/public/bixpay.html index 762fd50..71c79ba 100644 --- a/public/bixpay.html +++ b/public/bixpay.html @@ -165,7 +165,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/contract.html b/public/contract.html index 10097d7..d9041f5 100644 --- a/public/contract.html +++ b/public/contract.html @@ -143,7 +143,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.
- + diff --git a/public/conversion-tracking.html b/public/conversion-tracking.html index 6065464..c705b17 100644 --- a/public/conversion-tracking.html +++ b/public/conversion-tracking.html @@ -265,7 +265,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/disclaimer.html b/public/disclaimer.html index 8a50b25..ebff14c 100644 --- a/public/disclaimer.html +++ b/public/disclaimer.html @@ -27,7 +27,7 @@

You decide whether, and how much, to spend. Never spend more than you can afford to lose.

- + diff --git a/public/earning.html b/public/earning.html index eb99819..40175f2 100644 --- a/public/earning.html +++ b/public/earning.html @@ -97,6 +97,6 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/facts.html b/public/facts.html index 9abb6ed..217a745 100644 --- a/public/facts.html +++ b/public/facts.html @@ -127,7 +127,7 @@ - + diff --git a/public/friday.html b/public/friday.html index 9d8bb6e..a43ca6c 100644 --- a/public/friday.html +++ b/public/friday.html @@ -72,6 +72,6 @@ - + diff --git a/public/games.html b/public/games.html index 0cec09b..aec84a7 100644 --- a/public/games.html +++ b/public/games.html @@ -79,6 +79,6 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/index.html b/public/index.html index d4ccef2..1b692db 100644 --- a/public/index.html +++ b/public/index.html @@ -506,7 +506,7 @@ - + diff --git a/public/join.html b/public/join.html index 2842968..29998cb 100644 --- a/public/join.html +++ b/public/join.html @@ -158,7 +158,7 @@ InstantAdPay · Contract · Terms · Privacy · Disclaimer - + diff --git a/public/launch.html b/public/launch.html index 14eb4f9..6e02a8b 100644 --- a/public/launch.html +++ b/public/launch.html @@ -106,7 +106,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/ledger.html b/public/ledger.html index d7f5752..ed32fc6 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -41,7 +41,7 @@
InstantAdPay is the Polygon hub of the Crypto Team Build Network.
- + diff --git a/public/my.html b/public/my.html index a29bfc0..7db6720 100644 --- a/public/my.html +++ b/public/my.html @@ -1278,7 +1278,11 @@ Live ledger The contract Support + Terms + Earnings Disclaimer + Privacy Crypto Team Build Network + TrustClickz · 615 Green Valley Drive, Moody, AL 35004 @@ -1302,7 +1306,7 @@ - + diff --git a/public/partners.html b/public/partners.html index 378b487..922dfab 100644 --- a/public/partners.html +++ b/public/partners.html @@ -131,7 +131,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford to lose.
- + diff --git a/public/plays.html b/public/plays.html index 74b8154..c46f67f 100644 --- a/public/plays.html +++ b/public/plays.html @@ -194,7 +194,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.
- + diff --git a/public/presentation.html b/public/presentation.html index 35966ff..00da53b 100644 --- a/public/presentation.html +++ b/public/presentation.html @@ -87,6 +87,6 @@
InstantAdPay is the Polygon hub of the Crypto Team Build Network.
- + diff --git a/public/privacy.html b/public/privacy.html index b7cfe48..ebf04f6 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -32,7 +32,7 @@

We use reasonable safeguards, but no system is perfectly secure. Protect your email and your wallet.

- + diff --git a/public/refuel-guide.html b/public/refuel-guide.html index ad4966a..7d7c16c 100644 --- a/public/refuel-guide.html +++ b/public/refuel-guide.html @@ -261,6 +261,6 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/support.html b/public/support.html index 0994cab..2408943 100644 --- a/public/support.html +++ b/public/support.html @@ -20,7 +20,7 @@

Loading…

We will never ask for your recovery phrase or private key, and nobody from InstantAdPay will message you first asking for money or wallet access.

- + diff --git a/public/terms.html b/public/terms.html index 0554f13..40a6933 100644 --- a/public/terms.html +++ b/public/terms.html @@ -42,7 +42,7 @@

See also the Disclaimer and Privacy Policy. Questions: the support page or support@instantadpay.com.

- + diff --git a/public/tx.html b/public/tx.html index 7a07b17..69fb359 100644 --- a/public/tx.html +++ b/public/tx.html @@ -35,7 +35,7 @@

← Back to the live ledger · Read the contract review

- + diff --git a/public/wall.html b/public/wall.html index e3f423f..636a485 100644 --- a/public/wall.html +++ b/public/wall.html @@ -48,7 +48,7 @@ - + diff --git a/public/wallets.html b/public/wallets.html index 1d80e29..5fa6d73 100644 --- a/public/wallets.html +++ b/public/wallets.html @@ -123,7 +123,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never share your recovery phrase.
- + diff --git a/public/wednesday.html b/public/wednesday.html index f9a6f62..5ac9d33 100644 --- a/public/wednesday.html +++ b/public/wednesday.html @@ -65,6 +65,6 @@ - + diff --git a/releases.js b/releases.js index 29b150b..f566080 100644 --- a/releases.js +++ b/releases.js @@ -65,7 +65,7 @@ function renderPage() { h += '

Release notes

'; h += v.notes.length ? v.notes.map(n => '

' + esc(n.title) + n.tags.map(tagChip).join('') + '

' + fmt(n.date) + '

' + bodyHtml(n.body) + '
').join('') : '

No notes yet.

'; h += '

Suggestions and bug reports: the chat bubble on any page, or the InstantAdPay Telegram group.

'; - h += ''; + h += ''; return h; } module.exports = { init, notes, roadmap, saveNote, saveRoadmap, remove, publicView, renderPage, bodyHtml, TAGS, STATUSES }; diff --git a/server.js b/server.js index 08829b8..085768b 100644 --- a/server.js +++ b/server.js @@ -126,6 +126,7 @@ const videomaker = require('./videomaker'); // Circuit tool: promo videos with const TRAFFIC_PAGES = new Set(['/chasing-unicorns', '/', '/ledger', '/contract', '/shorts', '/plays', '/wallets', '/launch', '/partners', '/earning', '/games', '/blog', '/whats-new', '/leaderboard', '/friday', '/wednesday', '/refuel', '/conversion-tracking', '/presentation', '/support', '/bixpay']); let tankWaitCache = null; // dashboard: who is waiting for a sponsor (refreshed every minute) const geo = require('./geo'); // viewer country -> tier (DB-IP lite), for campaign targeting +const netsites = require('./netsites'); // footer network list from the hub (2026-11-14 trust pack) const burner = require('./burner'); // automatic on-chain credit burns (inert without ENGINE_KEY) const PORT = Number(process.env.PORT || 3000); @@ -2519,6 +2520,7 @@ const server = http.createServer(async (req, res) => { try { for (const b of (await blog.listPublished()).slice(0, 40)) pages.push({ path: '/blog/' + b.slug, title: 'Article: ' + b.title, cover: b.cover || null }); } catch (e) {} return json(res, 200, { pages }); } + if (p === '/api/network-sites' && req.method === 'GET') return netsites.handle(req, res); if (p === '/api/config' && req.method === 'GET') { const c = chain.getConfig(); // public copy of the site settings: never anything that looks like a credential @@ -6284,7 +6286,7 @@ const server = http.createServer(async (req, res) => { + '' + '
' + esc(label) + ' badge for @' + esc(un) + '

@' + esc(un) + ' unlocked ' + label + '

' + esc(sub.charAt(0).toUpperCase() + sub.slice(1)) + '. On InstantAdPay every ad package that sells pays the sponsor in the same transaction, straight to their wallet, on-chain.

' + 'Join @' + esc(un) + '\u2019s line free

Advertising with a performance referral program. Not an investment; no income is guaranteed.

' - + ''; + + ''; res.writeHead(200, baseHeaders({ 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'public, max-age=300' })); return res.end(html); }