Files
2026-11-16 09:23:17 -06:00

15 lines
1.3 KiB
JavaScript

// Front page: the reshare board, credit-featured ads, today's numbers and the PolHunter embed (hunters' visits never count).
(async function () {
const $ = VAS.$;
const d = await VAS.wire('front').catch(() => ({}));
const t = d.today || {};
$('todayStats').innerHTML = [[t.ads, 'ads running'], [t.reshares, 'reshares today'], [t.views, 'verified views today'], [t.vclicks, 'verified clicks today']]
.map(x => '<div class="stat"><b>' + VAS.n(x[0]) + '</b><span>' + x[1] + '</span></div>').join('');
const b = d.board || [];
$('boardAds').innerHTML = b.length ? b.map(x => VAS.adCard(x, { place: 'board', extra: '<a class="btn sm" style="margin-top:8px" href="/a/' + x.id + '">Open and reshare</a>' })).join('')
: '<p class="muted">No ads yet. <a href="/my#post">Post the first one free</a>.</p>';
VAS.featured($('featured'), d);
// PolHunter embed (the network pattern). The PolHunter mission itself is added in polhunter.com/admin at go-live (not made yet)
const ph = document.createElement('script'); ph.async = true; ph.src = 'https://polhunter.com/embed.js'; ph.setAttribute('data-slots', '3'); ph.setAttribute('data-selector', '#how .card-ink'); document.body.appendChild(ph); // the find code hides in one of the three "How an ad spreads" steps (the ViralAdBlitz pattern)
})();