From 6cc1c6d3660008c1e6ddb10835dc0b16a448574c Mon Sep 17 00:00:00 2001 From: martbost Date: Sat, 14 Nov 2026 10:12:59 -0600 Subject: [PATCH] Footer: 'Part of the network' column from the network hub (netsites.js: GET HUB_URL/v1/network-sites, 10 min cache, built-in fallback; Stack POL marked as current), company line TrustClickz, 615 Green Valley Drive, Moody, AL 35004, Support link; All games moves to Explore (never in the network list). Marty 2026-11-14 trust pack Co-Authored-By: Claude Opus 5.5 --- layout.js | 10 +++++++--- netsites.js | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 netsites.js diff --git a/layout.js b/layout.js index a9f1220..3eb035b 100644 --- a/layout.js +++ b/layout.js @@ -2,6 +2,7 @@ // Twitter card, RSS link, JSON-LD slots) and the site's own look (Polygon violet + coin gold on deep night, one dark theme on // purpose, matching the hero video). Server-rendered so crawlers read real HTML. 'use strict'; +const netsites = require('./netsites'); // footer network list from the hub (2026-11-14) const SITE = (process.env.SITE_URL || 'https://stackpol.com').replace(/\/+$/, ''); const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c])); const V = '20261109a'; @@ -163,10 +164,13 @@ function memberLinks(who, st) { function tail(extra) { const year = new Date().getFullYear(); return '
Stack POLEvery POL payout across the network, stacked in one place and checkable on Polygon.
' - + '
ExploreAll programsLive ledgerBlogRSS feed
' - + '
The networkInstantAdPayLinkSpinAll games
' + + '
ExploreAll programsLive ledgerBlogRSS feedAll gamesSupport
' + // Part of the network (Marty 2026-11-14 trust pack): the list comes from the hub (netsites.js, cached), built-in copy if not + + '
Part of the networkOne account across the network' + netsites.list().map(s => (s.id === 'stackpol' || /stackpol\.com/.test(s.url)) + ? '' + esc(s.name) + ' (you are here)' + : '' + esc(s.name) + '').join('') + '
' + '
Honest numbersTotals are the combined payouts of everyone in the network, read from each program\'s payout records and the Polygon chain. One member\'s results are not a promise of yours. Cryptocurrency involves risk.
' - + '

© ' + year + ' Stack POL, part of the Crypto Team Build Network. Stack POL shows payouts; it does not hold, invest or pay out anyone\'s money.

' + + '

© ' + year + ' Stack POL by TrustClickz, 615 Green Valley Drive, Moody, AL 35004. Part of the Crypto Team Build Network. Stack POL shows payouts; it does not hold, invest or pay out anyone\'s money.

' // PolHunter mission (Marty 2026-11-10): silent unless a hunter arrives with their own #ph token; the code lands on one of the // program cards (3 slots, which one rotates per hunter per day) + '' + (extra || '') + SPOT_JS + ''; 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 };