Network ad zones (punch list, Marty 2026-11-17): LinkSpin zones on Marty's account made through LinkSpin's admin zone route (footer wide 728x90, footer phone 320x50, ledger 468x60, not-found 300x250), the ViralAdBlitz pattern; common.js ?v=20261117z
Zones: ls-e5d152 / ls-1a1b1f / ls-20fdd0 / 404 ls-a8a737. Also GET /api/admin/member-lookup (read-only) for the network hub's admin lookup, like ViralAdBlitz. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -450,6 +450,19 @@ const server = http.createServer(async (req, res) => {
|
||||
const row = { rank: Number(b.rank) || l.length + 1, coach: String(b.coach).toLowerCase(), username: display(String(b.coach).toLowerCase()), wei: String(BigInt(b.wei || 0)), tx: String(b.tx).toLowerCase(), at: Date.now() };
|
||||
l.push(row); store.save(); proof.payoutLine(b.week, row).catch(() => {}); return json(res, 200, { ok: true, row });
|
||||
}
|
||||
// the network hub's admin member lookup (2026-11-17, read-only, like ViralAdBlitz): ?q=<wallet | @username> ->
|
||||
// { address, record, positions, purchases, picks, credits }; never a session or contact data
|
||||
if (p === '/api/admin/member-lookup' && req.method === 'GET') {
|
||||
const q = String(u.searchParams.get('q') || '').trim().replace(/^@/, ''); let a = null;
|
||||
if (ADDR_RE.test(q)) a = q.toLowerCase(); else if (NAME_RE.test(q)) { const m = store.memberByName(q); a = m ? m.address : null; }
|
||||
if (!a) return json(res, 404, { error: 'not found' });
|
||||
const m = store.member(a); if (!m && !store.positionsOf(a)) return json(res, 200, { address: a, known: false });
|
||||
const rec = m ? { username: m.username || null, hubId: m.hubId || null, joinedAt: m.joinedAt || null, lastSeen: m.lastSeen || null, via: m.via || null, netOk: !!m.netOk } : null;
|
||||
const mine = store.picksOf(a); const cnt = s => mine.filter(x => x.status === s).length;
|
||||
return json(res, 200, { address: a, record: rec, positions: store.positionsOf(a), credits: store.credits(a),
|
||||
purchases: store.purchases().filter(x => x.buyer === a).map(x => ({ at: x.blockAt ? x.blockAt * 1000 : x.at || null, qty: Number(x.qty) || 1, tx: String(x.key || '').split(':')[0] || x.tx || null })),
|
||||
picks: { all: mine.length, open: cnt('open'), done: cnt('done'), returned: cnt('returned'), kept: cnt('kept') } });
|
||||
}
|
||||
if (p === '/api/admin/oldrefs' && req.method === 'POST') {
|
||||
let b; try { b = JSON.parse((await readRaw(req, 4 * 1024 * 1024)).toString('utf8')); } catch (e) { return json(res, 400, { error: 'bad json' }); }
|
||||
if (!b || !b.oldrefs || typeof b.oldrefs !== 'object') return json(res, 400, { error: 'oldrefs object required' });
|
||||
@@ -462,7 +475,7 @@ const server = http.createServer(async (req, res) => {
|
||||
|
||||
if (p.startsWith('/api/')) return json(res, 404, { error: 'Not found' });
|
||||
res.writeHead(404, headers({ 'Content-Type': 'text/html; charset=utf-8' }));
|
||||
return res.end('<!doctype html><meta name="viewport" content="width=device-width,initial-scale=1"><title>Not found | 5xYourTeam</title><body style="background:#0b1530;color:#eef2fb;font-family:Inter,system-ui,sans-serif;text-align:center;padding:40px 16px"><p style="font-size:22px;font-weight:700">Not found.</p><p><a style="color:#ffc93c;font-weight:700" href="/">Back to the draft board</a></p></body>');
|
||||
return res.end('<!doctype html><meta name="viewport" content="width=device-width,initial-scale=1"><title>Not found | 5xYourTeam</title><body style="background:#0b1530;color:#eef2fb;font-family:Inter,system-ui,sans-serif;text-align:center;padding:40px 16px"><p style="font-size:22px;font-weight:700">Not found.</p><p><a style="color:#ffc93c;font-weight:700" href="/">Back to the draft board</a></p><p style="font-size:11px;margin:24px 0 4px;opacity:.7">Network</p><script async src="https://linkspin.app/z.js" data-zone="ls-a8a737"></script></body>');
|
||||
} catch (e) {
|
||||
console.error('request', p, e.message);
|
||||
if (!res.headersSent) json(res, 500, { error: 'Server error' });
|
||||
|
||||
Reference in New Issue
Block a user