Tracked network links (Marty 2026-11-14: "make sure each of these sites is its own traffic source and link spun so we can track it"): the footer's Part of the network links go through the LinkSpin network link for each site with ?src=stackpol (linkspin.app/r/<code>, rel nofollow), so LinkSpin Reports show Stack POL as the source. netsites.js gains tracked() + go on /api/network-sites (same file in all five sites). Footer render checked locally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 11:38:03 -06:00
parent 275a5a48bc
commit 1735748ee6
2 changed files with 23 additions and 3 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ function tail(extra) {
// Part of the network (Marty 2026-11-14 trust pack): the list comes from the hub (netsites.js, cached), built-in copy if not
+ '<div><b>Part of the network</b><span style="display:block;margin-bottom:4px">One account across the network</span>' + netsites.list().map(s => (s.id === 'stackpol' || /stackpol\.com/.test(s.url))
? '<span aria-current="page" style="display:block;margin:3px 0;color:var(--ink);font-weight:600">' + esc(s.name) + ' (you are here)</span>'
: '<a href="' + esc(s.url) + '" rel="noopener">' + esc(s.name) + '</a>').join('') + '</div>'
: '<a href="' + esc(netsites.tracked(s.id, 'stackpol') || s.url) + '" rel="noopener nofollow">' + esc(s.name) + '</a>').join('') + '</div>'
+ '<div><b>Honest numbers</b>Totals 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.</div></footer>'
+ '<p class="disc">&copy; ' + 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.</p>'
// PolHunter mission (Marty 2026-11-10): silent unless a hunter arrives with their own #ph token; the code lands on one of the
+22 -2
View File
@@ -32,9 +32,29 @@ function refresh() {
return inflight;
}
function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list; }
// Tracked links (Marty 2026-11-14: "make sure each of these sites is its own traffic source and link spun so we can track it"): each
// entry also gets go = the LinkSpin network link for that site with ?src=<this site>, so a click shows in LinkSpin Reports under the
// site that sent it (LinkSpin netlinks.js: fixed codes on the admin account). This site = NETWORK_SITE_ID, else the request host.
// No go for this site itself, or when this site cannot be told (a test host): the page then uses the plain url.
const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', stackpol: 'nwsp', earnerscorner: 'nwec' };
const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, '');
const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
function selfId(req, l) {
const env = String(process.env.NETWORK_SITE_ID || '').trim().toLowerCase(); if (env) return env;
const h = String((req && req.headers && (req.headers['x-forwarded-host'] || req.headers.host)) || '').split(',')[0].trim().toLowerCase().replace(/:\d+$/, '').replace(/^www\./, '');
const m = h && (l || list()).find(s => hostOf(s.url) === h); return m ? m.id : '';
}
// the LinkSpin-tracked link to site `id` sent from site `from` (from = id: the site's own promo kit); extra = { s1: member username, s2: one path segment }
function tracked(id, from, extra) {
const code = CODES[id]; if (!code || !from) return '';
const q = new URLSearchParams({ src: from }); for (const [k, v] of Object.entries(extra || {})) if (v) q.set(k, String(v));
return linksBase() + '/r/' + code + '?' + q.toString();
}
function withGo(l, me) { return l.map(s => { const go = me && s.id !== me ? tracked(s.id, me) : ''; return go ? Object.assign({}, s, { go }) : s; }); }
// GET /api/network-sites: public, cacheable, the same answer on every page
function handle(req, res) {
const l = list();
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()));
res.end(JSON.stringify(withGo(l, selfId(req, l))));
}
module.exports = { list, handle, refresh, FALLBACK, _state: () => cache };
module.exports = { list, handle, refresh, tracked, selfId, withGo, CODES, FALLBACK, _state: () => cache };