Files
viraladsource/public/assets/promote.js
T
Marty Bostick edaf98c8f6 ViralAdSource app (Marty approved 2026-11-16): free text ads that spread by reshares, each ad with its own family tree
Watershed look from the approved mockup (hero, topo pattern, icons). Network sign-in through the hub, hub membership, activity ping.
Reshare links per member per ad with branch/step tracking; family-tree dashboard (branch, step, reshares, views, clicks, sign-ups, Boosts).
Verified views earn ad credits for the branch's resharer (L3). L2 sign-up pipeline (hub-new, confirmed email, not self device/IP,
throwaway block, daily cap, fraud score) with keeper-signed reward vouchers and a pending-rewards ledger; payouts OFF (REWARD_PAYOUTS).
L1 Boosts through VASShop with signed orders naming the sponsor line and the resharer. Trust pack, chatbot, promo kit, PolHunter embed.
All numbers are PROPOSALS until Marty sets them. qa/e2e.mjs 59/59 on a local anvil chain, chatbot test 108/108.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 09:19:34 -06:00

16 lines
1.6 KiB
JavaScript

// Promote page: the promo kit from /api/promo-kit with the member's network username in every link.
(async function () {
const $ = VAS.$, esc = VAS.esc;
let u = new URLSearchParams(location.search).get('u') || '';
if (!u) { const me = await VAS.getJSON('/api/me').catch(() => ({})); if (me.signedIn && me.username) u = me.username; }
$('kitUser').value = u;
async function show() {
const k = await VAS.getJSON('/api/promo-kit?u=' + encodeURIComponent($('kitUser').value.trim().replace(/^@/, '')));
$('kit').innerHTML = '<section class="panel"><h2 style="font-size:24px">Your links</h2>' + k.links.map(l => '<p><b>' + esc(l.label) + '</b><br><span class="mono" style="word-break:break-all">' + esc(l.tracked || l.url) + '</span></p>').join('') + '</section>'
+ '<section class="panel" style="margin-top:18px"><h2 style="font-size:24px">Lines to post</h2>' + k.lines.map(x => '<p>' + esc(x) + '</p>').join('') + '<h3>Email</h3><p><b>' + esc(k.email.subject) + '</b></p><p style="white-space:pre-wrap">' + esc(k.email.body) + '</p></section>'
+ (k.creatives.length ? '<section class="panel" style="margin-top:18px"><h2 style="font-size:24px">Creatives</h2><div class="row">' + k.creatives.map(c => '<figure style="margin:0"><img src="' + esc(c.url) + '" width="' + Math.min(c.w, 300) + '" alt="' + esc(c.angleLabel) + '"><figcaption class="muted" style="font-size:13px">' + esc(c.label) + ' ' + c.w + 'x' + c.h + '</figcaption></figure>').join('') + '</div></section>' : '')
+ '<p class="muted">' + esc(k.note) + '</p>';
}
$('kitUser').addEventListener('change', show); show();
})();