DownlineHydra as a network site (2026-11-15 go-live): fixed network link nwdh -> https://downlinehydra.com/{s2}?ref={s1} on the admin account (catalog network template downlinehydra + NET_SRC dh/downlinehydra already there), netsites CODES downlinehydra: nwdh; qa netsrc expects nine network links + nwdh redirect. LOCAL, not run here (qa on hold for the VAB lane's suite)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ const SITES = [
|
|||||||
{ id: 'vbb', code: 'nwvbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com/{s2}?ref={s1}' },
|
{ id: 'vbb', code: 'nwvbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com/{s2}?ref={s1}' },
|
||||||
{ id: 'viraladblitz', code: 'nwvab', name: 'ViralAdBlitz', url: 'https://viraladblitz.com/{s2}?ref={s1}' },
|
{ id: 'viraladblitz', code: 'nwvab', name: 'ViralAdBlitz', url: 'https://viraladblitz.com/{s2}?ref={s1}' },
|
||||||
{ id: 'fivex', code: 'nw5x', name: '5xYourTeam', url: 'https://5xyourteam.com/{s2}?ref={s1}' },
|
{ id: 'fivex', code: 'nw5x', name: '5xYourTeam', url: 'https://5xyourteam.com/{s2}?ref={s1}' },
|
||||||
|
{ id: 'downlinehydra', code: 'nwdh', name: 'DownlineHydra', url: 'https://downlinehydra.com/{s2}?ref={s1}' },
|
||||||
{ id: 'stackpol', code: 'nwsp', name: 'Stack POL', url: 'https://stackpol.com/{s2}?ref={s1}' },
|
{ id: 'stackpol', code: 'nwsp', name: 'Stack POL', url: 'https://stackpol.com/{s2}?ref={s1}' },
|
||||||
{ id: 'earnerscorner', code: 'nwec', name: 'Earners Corner', url: 'https://earnerscorner.com/{s2}' }
|
{ id: 'earnerscorner', code: 'nwec', name: 'Earners Corner', url: 'https://earnerscorner.com/{s2}' }
|
||||||
];
|
];
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list;
|
|||||||
// entry also gets go = the LinkSpin network link for that site with ?src=<this site>, so a click shows in LinkSpin Reports under the
|
// 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.
|
// 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.
|
// 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', viraladblitz: 'nwvab', fivex: 'nw5x', stackpol: 'nwsp', earnerscorner: 'nwec' };
|
const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', fivex: 'nw5x', downlinehydra: 'nwdh', stackpol: 'nwsp', earnerscorner: 'nwec' };
|
||||||
const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, '');
|
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 ''; } };
|
const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
|
||||||
function selfId(req, l) {
|
function selfId(req, l) {
|
||||||
|
|||||||
+6
-4
@@ -1,5 +1,5 @@
|
|||||||
// Network sites as traffic sources (2026-11-14). Boots server.js on its own port with a throwaway seeded data dir (JSON store, no DB)
|
// Network sites as traffic sources (2026-11-14). Boots server.js on its own port with a throwaway seeded data dir (JSON store, no DB)
|
||||||
// and checks: the admin account gets one fixed network link per site (nwiap, nwls, nwdlb, nwvbb, nwvab, nw5x, nwsp, nwec) and one source per
|
// and checks: the admin account gets one fixed network link per site (nwiap, nwls, nwdlb, nwvbb, nwvab, nw5x, nwdh, nwsp, nwec) and one source per
|
||||||
// network site; /r/<code>?src=&s1=&s2= lands on the right page with ?ref=<member>; the click counts under the sending site's source;
|
// network site; /r/<code>?src=&s1=&s2= lands on the right page with ?ref=<member>; the click counts under the sending site's source;
|
||||||
// a member's own link with ?src=<site> gets that site's source made on first use; an unknown src changes nothing; a reboot makes
|
// a member's own link with ?src=<site> gets that site's source made on first use; an unknown src changes nothing; a reboot makes
|
||||||
// nothing twice.
|
// nothing twice.
|
||||||
@@ -28,9 +28,9 @@ const srcOf = (owner, tpl) => read('sources.json').items.find(x => x.owner === o
|
|||||||
try {
|
try {
|
||||||
await boot();
|
await boot();
|
||||||
const rots = read('rotator.json').rotations.filter(r => r.owner === ADMIN);
|
const rots = read('rotator.json').rotations.filter(r => r.owner === ADMIN);
|
||||||
ok(['nwiap', 'nwls', 'nwdlb', 'nwvbb', 'nwvab', 'nw5x', 'nwsp', 'nwec'].every(c => rots.some(r => r.code === c)) && rots.length === 8, 'the admin account has the eight network links', rots.map(r => r.code));
|
ok(['nwiap', 'nwls', 'nwdlb', 'nwvbb', 'nwvab', 'nw5x', 'nwdh', 'nwsp', 'nwec'].every(c => rots.some(r => r.code === c)) && rots.length === 9, 'the admin account has the nine network links', rots.map(r => r.code));
|
||||||
const mineSrc = read('sources.json').items.filter(x => x.owner === ADMIN);
|
const mineSrc = read('sources.json').items.filter(x => x.owner === ADMIN);
|
||||||
ok(['instantadpay', 'linkspin', 'downlinebanners', 'viralbannerblitz', 'viraladblitz', '5xyourteam', 'stackpol', 'earnerscorner'].every(t => mineSrc.some(x => x.template === t)) && mineSrc.length === 8, 'and one source per network site', mineSrc.map(x => x.template));
|
ok(['instantadpay', 'linkspin', 'downlinebanners', 'viralbannerblitz', 'viraladblitz', '5xyourteam', 'downlinehydra', 'stackpol', 'earnerscorner'].every(t => mineSrc.some(x => x.template === t)) && mineSrc.length === 9, 'and one source per network site', mineSrc.map(x => x.template));
|
||||||
|
|
||||||
let r = await go('/r/nwdlb?src=iap&s1=bob&s2=how');
|
let r = await go('/r/nwdlb?src=iap&s1=bob&s2=how');
|
||||||
ok(r.status === 302 && /^https:\/\/downlinebanners\.com\/how\?ref=bob$/.test(r.loc), 'nwdlb: lands on /how with ?ref=bob', r);
|
ok(r.status === 302 && /^https:\/\/downlinebanners\.com\/how\?ref=bob$/.test(r.loc), 'nwdlb: lands on /how with ?ref=bob', r);
|
||||||
@@ -38,6 +38,8 @@ try {
|
|||||||
ok(r.status === 302 && /^https:\/\/instantadpay\.com\/\?ref=amy&lsclk=[a-f0-9]{10}$/.test(r.loc), 'nwiap: home page with ?ref=amy and the click id (InstantAdPay reports joins against it)', r);
|
ok(r.status === 302 && /^https:\/\/instantadpay\.com\/\?ref=amy&lsclk=[a-f0-9]{10}$/.test(r.loc), 'nwiap: home page with ?ref=amy and the click id (InstantAdPay reports joins against it)', r);
|
||||||
r = await go('/r/nwec?src=dlb');
|
r = await go('/r/nwec?src=dlb');
|
||||||
ok(r.status === 302 && /^https:\/\/earnerscorner\.com\/(\?|$)/.test(r.loc), 'nwec: the forum home', r);
|
ok(r.status === 302 && /^https:\/\/earnerscorner\.com\/(\?|$)/.test(r.loc), 'nwec: the forum home', r);
|
||||||
|
r = await go('/r/nwdh?src=downlinehydra&s1=bob');
|
||||||
|
ok(r.status === 302 && /^https:\/\/downlinehydra\.com\/\?ref=bob$/.test(r.loc), 'nwdh: DownlineHydra with the member ref', r);
|
||||||
r = await go('/r/nw5x?src=fivex&s1=bob');
|
r = await go('/r/nw5x?src=fivex&s1=bob');
|
||||||
ok(r.status === 302 && /^https:\/\/5xyourteam\.com\/\?ref=bob$/.test(r.loc), 'nw5x: 5xYourTeam with the member ref', r);
|
ok(r.status === 302 && /^https:\/\/5xyourteam\.com\/\?ref=bob$/.test(r.loc), 'nw5x: 5xYourTeam with the member ref', r);
|
||||||
r = await go('/r/nwvab?src=vab&s1=bob&s2=boost');
|
r = await go('/r/nwvab?src=vab&s1=bob&s2=boost');
|
||||||
@@ -62,7 +64,7 @@ try {
|
|||||||
ok(read('sources.json').items.filter(x => x.owner === MEM).length === 2, 'an unknown src makes no source');
|
ok(read('sources.json').items.filter(x => x.owner === MEM).length === 2, 'an unknown src makes no source');
|
||||||
|
|
||||||
await stop(); await boot();
|
await stop(); await boot();
|
||||||
ok(read('rotator.json').rotations.filter(x => x.owner === ADMIN).length === 8 && read('sources.json').items.filter(x => x.owner === ADMIN).length === 8, 'a reboot makes nothing twice');
|
ok(read('rotator.json').rotations.filter(x => x.owner === ADMIN).length === 9 && read('sources.json').items.filter(x => x.owner === ADMIN).length === 9, 'a reboot makes nothing twice');
|
||||||
} catch (e) { fail++; console.error(e); }
|
} catch (e) { fail++; console.error(e); }
|
||||||
finally { await stop(); try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} }
|
finally { await stop(); try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} }
|
||||||
console.log('\n' + pass + ' passed, ' + fail + ' failed'); process.exit(fail ? 1 : 0);
|
console.log('\n' + pass + ' passed, ' + fail + ' failed'); process.exit(fail ? 1 : 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user