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"). netsites.js: /api/network-sites adds go = the LinkSpin network link for each site with ?src=<this site> (linkspin.app/r/<code>, fixed codes on Marty's LinkSpin account), this site found by NETWORK_SITE_ID or the request host; the footer uses go (rel nofollow), plain url as fallback. Promo kit: every link gets a tracked twin (linkspin.app/r/nwvbb?src=vbb&s1=<member>&s2=<page>, lands on the same page with ?ref=<member>), trackedTemplate; /promote shows both. Same netsites.js in all five sites. common.js?v=7, kitpage.js?v=2. Smoke 242/242
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+22
-2
@@ -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 };
|
||||
|
||||
+7
-4
@@ -9,6 +9,7 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const C = require('./config').get();
|
||||
const netsites = require('./netsites'); // tracked links: LinkSpin network link for this site, ?src=<this site> (2026-11-14)
|
||||
|
||||
const KIT_DIR = path.join(__dirname, 'public', 'art', 'kit');
|
||||
const SHAPES = { tile: [125, 125, 'Square button (loop size)'], strip: [468, 60, 'Strip'], leader: [728, 90, 'Leaderboard'], box: [300, 250, 'Box'],
|
||||
@@ -75,16 +76,18 @@ function kit(u) {
|
||||
const q = ref ? '?ref=' + encodeURIComponent(ref) : '';
|
||||
const link = base() + '/' + q;
|
||||
const fill = s => s.split('{{LINK}}').join(link);
|
||||
// the same page through LinkSpin (Marty 2026-11-14: each network site its own traffic source): counted under this site, lands with ?ref=
|
||||
const track = seg => netsites.tracked('vbb', 'vbb', { s1: ref, s2: seg });
|
||||
const t = copy();
|
||||
return {
|
||||
v: 1, site: C.site, name: C.siteName, updated: '2026-11-14', username: ref || null,
|
||||
tagline: 'One shared loop of 125x125 banners. Real visitors push it.',
|
||||
links: [
|
||||
{ key: 'home', label: 'Your link (the loop)', url: link },
|
||||
{ key: 'how', label: 'How it works', url: base() + '/how' + q },
|
||||
{ key: 'leaders', label: 'Weekly leaderboards', url: base() + '/leaders' + q }
|
||||
{ key: 'home', label: 'Your link (the loop)', url: link, tracked: track('') },
|
||||
{ key: 'how', label: 'How it works', url: base() + '/how' + q, tracked: track('how') },
|
||||
{ key: 'leaders', label: 'Weekly leaderboards', url: base() + '/leaders' + q, tracked: track('leaders') }
|
||||
],
|
||||
linkTemplate: base() + '/?ref={username}',
|
||||
linkTemplate: base() + '/?ref={username}', trackedTemplate: netsites.tracked('vbb', 'vbb') + '&s1={username}',
|
||||
creatives: creatives().map(c => Object.assign({}, c, { html: '<a href="' + link + '" target="_blank" rel="noopener"><img src="' + c.url + '" width="' + c.w + '" height="' + c.h + '" alt="Viral Banner Blitz"></a>' })),
|
||||
lines: t.lines.map(fill), headlines: t.headlines, email: { subject: t.email.subject, body: fill(t.email.body) }, posts: t.posts.map(fill),
|
||||
note: NOTE, promotePage: base() + '/promote'
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/admin.js?v=2"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -61,7 +61,7 @@ window.VBB = (function () {
|
||||
function netLine(el) {
|
||||
if (!el) return;
|
||||
const paint = list => { el.innerHTML = '<b>Part of the network</b> · One account across the network: ' + list.map(s => (s.id === 'vbb' || /viralbannerblitz\.com/.test(s.url))
|
||||
? '<span class="here" aria-current="page">' + esc(s.name) + '</span>' : '<a href="' + esc(s.url) + '" target="_blank" rel="noopener">' + esc(s.name) + '</a>').join(' · '); };
|
||||
? '<span class="here" aria-current="page">' + esc(s.name) + '</span>' : '<a href="' + esc(s.go || s.url) + '" target="_blank" rel="noopener nofollow">' + esc(s.name) + '</a>').join(' · '); };
|
||||
paint(NET);
|
||||
fetch('/api/network-sites').then(r => r.json()).then(l => { if (Array.isArray(l) && l.length) paint(l); }).catch(() => {});
|
||||
}
|
||||
|
||||
@@ -13,13 +13,15 @@ window.KitPage = (function () {
|
||||
const cb = (text, label, cls) => { TXT.push(text); return '<button type="button" class="btn small ' + (cls || 'sec') + '" data-kc="' + (TXT.length - 1) + '">' + esc(label || 'Copy') + '</button>'; };
|
||||
// on the kit's own site, show creatives from this origin (same files; the copied URL stays absolute)
|
||||
function local(url, k) { try { const u = new URL(url); return u.hostname === k.site && location.hostname !== k.site ? u.pathname : url; } catch (e) { return url; } }
|
||||
const row = (label, url, cls) => '<div class="kit-row"><div class="kit-l"><span class="kit-lab">' + esc(label) + '</span><code class="kit-url">' + esc(url) + '</code></div>' + cb(url, 'Copy link', cls) + '</div>';
|
||||
function render(root, k) {
|
||||
TXT.length = 0;
|
||||
const angles = []; const by = {};
|
||||
(k.creatives || []).forEach(c => { if (!by[c.angle]) { by[c.angle] = []; angles.push(c); } by[c.angle].push(c); });
|
||||
let h = '';
|
||||
h += '<div class="card"><h3>Your links</h3>' + (k.username ? '<p class="muted small">Every link, creative and line below carries <b>' + esc(k.username) + '</b>.</p>' : '<p class="muted small">Add your network username above so these links carry it.</p>')
|
||||
+ k.links.map(l => '<div class="kit-row"><div class="kit-l"><span class="kit-lab">' + esc(l.label) + '</span><code class="kit-url">' + esc(l.url) + '</code></div>' + cb(l.url, 'Copy link', '') + '</div>').join('') + '</div>';
|
||||
+ k.links.map(l => row(l.label, l.url, '') + (l.tracked ? row(l.label + ', tracked', l.tracked, 'sec') : '')).join('')
|
||||
+ (k.links.some(l => l.tracked) ? '<p class="muted small">A tracked link goes through LinkSpin first, so the network can see which site sent the visit, then opens the same page with your username. Use either one.</p>' : '') + '</div>';
|
||||
h += '<div class="card"><h3>Creatives</h3><p class="muted small">Download them, or copy the HTML: it already links to you.</p><div class="kit-tabs" role="tablist">'
|
||||
+ angles.map((c, i) => '<button type="button" class="kit-tab' + (i ? '' : ' on') + '" data-ka="' + esc(c.angle) + '">' + esc(c.angleLabel) + '</button>').join('') + '</div>';
|
||||
angles.forEach((a, i) => {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/contract.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="card"><h2>Your decision</h2><p>Only spend what you can afford to lose completely. This is not financial, legal or tax advice. You are responsible for any taxes on what you receive.</p></div>
|
||||
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/splash.js?v=3"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
<div class="card" id="pastCard" hidden><h2>Past winners</h2><p class="muted small">Paid in POL from the prize wallet at the POL price at payout time. Every payment is a public Polygon transaction.</p><div class="past" id="past"></div></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/leaders.js?v=3"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/ledger.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@
|
||||
</div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/wallet.js?v=2"></script>
|
||||
<script src="/assets/buy.js?v=1"></script>
|
||||
<script src="/assets/my.js?v=3"></script>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="card center"><p>Every network member (InstantAdPay or LinkSpin) also gets one free post credit each day they sign in.</p><a class="btn sec" href="/my">Use my free credit</a></div>
|
||||
<div id="status" class="note" hidden></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/wallet.js?v=2"></script>
|
||||
<script src="/assets/buy.js?v=1"></script>
|
||||
<script src="/assets/packages.js?v=1"></script>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
<div class="card"><h2>Your choices</h2><p>You can ask us to delete your account data on this site or on the network hub. Records on the blockchain cannot be deleted by anyone. You can clear the cookies in your browser at any time; you will need to sign in again.</p></div>
|
||||
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@
|
||||
<div id="status" class="note" hidden></div>
|
||||
<div id="kit"><p class="muted">Loading the kit...</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/kitpage.js?v=1"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/kitpage.js?v=2"></script>
|
||||
<script src="/assets/promote.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
<div class="card"><h2>Limits</h2><p>As far as the law allows, we are not responsible for losses caused by the blockchain, your wallet, the price of POL, third-party websites in banners, or events outside our control, and our total responsibility to you is limited to what you paid for the purchase in question. These terms are governed by the laws of the State of Alabama, USA.</p></div>
|
||||
<div class="card"><h2>Contact</h2><p>Questions, problems or a request about your data: <a href="https://instantadpay.com/support" target="_blank" rel="noopener">network support</a>, or write to TrustClickz, 615 Green Valley Drive, Moody, AL 35004.</p></div>
|
||||
</main>
|
||||
<script src="/assets/common.js?v=6"></script>
|
||||
<script src="/assets/common.js?v=7"></script>
|
||||
<script src="/assets/static.js?v=1"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -186,6 +186,7 @@ async function main() {
|
||||
const kr = await anon.req('/api/promo-kit?u=smokeleader'); const k = await kr.json();
|
||||
ok(kr.status === 200 && kr.headers.get('access-control-allow-origin') === '*', 'promo kit: GET /api/promo-kit 200 with CORS open', kr.status);
|
||||
ok(k.username === 'smokeleader' && k.links.length === 3 && k.links.every(l => l.url.startsWith('https://viralbannerblitz.com/') && l.url.endsWith('?ref=smokeleader')), 'promo kit: every link carries ?ref=<username>', k.links);
|
||||
ok(k.links.every(l => /^https:\/\/linkspin\.app\/r\/nwvbb\?src=vbb&s1=smokeleader(&s2=[a-z]+)?$/.test(l.tracked)) && k.links[0].tracked.indexOf('&s2=') < 0 && /&s2=how$/.test(k.links[1].tracked), 'promo kit: every link has a LinkSpin-tracked twin (network link nwvbb, source vbb, the member as s1, the page as s2)', k.links.map(l => l.tracked));
|
||||
ok(k.lines.length === 5 && k.headlines.length === 3 && k.posts.length === 2 && k.email && k.email.subject && k.email.body.includes('?ref=smokeleader'), 'promo kit: 5 lines, 3 headlines, 1 email, 2 posts, link filled in');
|
||||
const words = JSON.stringify([k.lines, k.headlines, k.email, k.posts, k.note, k.tagline]);
|
||||
ok(!/[—–]/.test(words) && !/\$50|passive income|guaranteed (income|returns|profit)|earn (cash|money)|make money/i.test(words) && /at least \$20/.test(words), 'promo kit copy: no dashes, no cap, no income promises, pot shown as at least $20');
|
||||
|
||||
Reference in New Issue
Block a user