Wired Wednesday: bonus is wired into the balance (purchased-grade, any format), no forced visits campaign; all copy corrected

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-29 05:42:08 -05:00
parent 5b54debf72
commit 8a6029cd90
14 changed files with 39 additions and 53 deletions
+12 -26
View File
@@ -1,8 +1,8 @@
// Wired Wednesday (Marty, 2026-09-29). Every Wednesday, Central time, any ad package of $10 or more
// earns +25% bonus credits that are WIRED straight into a verified-visits campaign pointed at the
// buyer's invite link: the bonus is running before they close the tab, and the network's daily
// earners get fresh visit inventory (the one format that keeps selling out). Credited the moment
// the purchase indexes, labelled in the credit log, campaign named after the promo.
// earns +25% bonus credits, WIRED into the buyer's balance the second the purchase indexes: purchased-grade,
// so they run on any format including login ads, and labelled in the credit log. (An earlier draft spent the
// bonus on a verified-visits campaign automatically; Marty killed that on 09-29: visits only reach members
// who already joined, so forcing the bonus into that one format was self-defeating for recruiters.)
//
// Same bones as Five Dollar Friday (friday.js): Central-day window, once per tx, the day's wave on
// the bridge page and the Overview card, Telegram at every ten packs, a wrap-up after midnight.
@@ -68,7 +68,7 @@ function stats(dayKey) {
const buyers = new Set(p.map(e => e.buyerId)).size;
const g = Object.values(S.granted || {}).filter(x => x.day === day);
return { day, packs: p.length, usd, buyers, polPaid: paid.pol, payouts: paid.n,
bonusCredits: g.reduce((s, x) => s + x.bonus, 0), visits: g.reduce((s, x) => s + (x.visits || 0), 0), campaigns: g.filter(x => x.campaignId).length };
bonusCredits: g.reduce((s, x) => s + x.bonus, 0) };
}
function view() {
const c = cfg(); const now = Date.now(); const live = liveNow(now); const next = nextWednesday(now);
@@ -88,28 +88,14 @@ async function onEvent(ev) {
const a = await X.accounts.byMemberId(ev.buyerId); if (!a || !a.email) return null;
const usd = ('$' + (ev.priceCents / 100).toFixed(2)).replace(/\.00$/, '');
const ref = 'ww:' + String(ev.tx).slice(0, 30);
await X.ads.addEarned(a.email, bonus, { log: { kind: 'bonus', note: 'Wired Wednesday: +' + c.pct + '% on your ' + usd + ' package, wired into a verified-visits campaign', ref } });
await X.ads.addEarned(a.email, bonus, { purchased: true, log: { kind: 'bonus', note: 'Wired Wednesday: +' + c.pct + '% on your ' + usd + ' package', ref } });
S.granted[ev.tx] = { day: dayOf(ev.ts), memberId: ev.buyerId, bonus, at: Date.now() }; save();
// wire it: a visits pack for as many verified visits as the bonus buys
const perVisit = Number((X.rates && X.rates().visitCostPerVisit) || 3);
const count = Math.floor(bonus / perVisit);
const link = SITE + '/join/' + (a.username || a.code || ev.buyerId);
let made = null, why = '';
try {
const r = await X.ads.createCampaign(a.email, ev.buyerId, { type: 'visits', name: 'Wired Wednesday: verified visits to my invite', targetUrl: link, count, title: 'Wired Wednesday bonus' }, [ev.buyerId]);
if (r && !r.error) { made = r.campaign || r; S.granted[ev.tx].campaignId = made.id; S.granted[ev.tx].visits = count; save(); }
else why = (r && r.error) || 'could not create the campaign';
} catch (e) { why = e.message; }
const text = made
? 'Your ' + usd + ' package landed on a Wired Wednesday, so ' + bonus + ' bonus credits (+' + c.pct + '%) were wired straight into a verified-visits campaign: ' + count + ' real visits to your invite link, already running. Watch it under Campaigns: ' + SITE + '/my#campaigns'
: 'Your ' + usd + ' package landed on a Wired Wednesday, so ' + bonus + ' bonus credits (+' + c.pct + '%) were added to your balance. We could not start the visits campaign for you automatically (' + why + '), so the credits are yours to spend on any format: ' + SITE + '/my#campaigns';
try { await X.notify(ev.buyerId, 'Wired Wednesday: +' + bonus + ' bonus credits' + (made ? ', already running' : ''), text, 'notice'); } catch (e) {}
if (!made) console.warn('wednesday: campaign not created for member', ev.buyerId, why);
try { await X.notify(ev.buyerId, 'Wired Wednesday: +' + bonus + ' bonus credits, wired in', 'Your ' + usd + ' package landed on a Wired Wednesday, so ' + bonus + ' bonus credits (+' + c.pct + '%) were wired into your balance the moment it settled. They are purchased-grade, so they run on any format, login ads included. Spend them under Campaigns: ' + SITE + '/my#campaigns', 'notice'); } catch (e) {}
// the wave, every ten packs
const st = stats(dayOf(ev.ts));
if (st.packs > 0 && st.packs % 10 === 0 && !S.posts[st.day + ':' + st.packs]) {
S.posts[st.day + ':' + st.packs] = Date.now(); save();
X.telegram('\u{26A1} <b>Wired Wednesday</b> · <b>' + st.packs + ' packs</b> so far today from ' + st.buyers + ' buyers, <b>' + st.visits.toLocaleString() + ' verified visits</b> wired to their invite pages, <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members in the same transactions.\nEvery $' + (c.minCents / 100) + '+ pack today gets +' + c.pct + '% wired in: ' + SITE + '/my#buy').catch(() => {});
X.telegram('\u{26A1} <b>Wired Wednesday</b> · <b>' + st.packs + ' packs</b> so far today from ' + st.buyers + ' buyers, <b>' + st.bonusCredits.toLocaleString() + ' bonus credits</b> wired in, <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members in the same transactions.\nEvery $' + (c.minCents / 100) + '+ pack today gets +' + c.pct + '% wired in the second it settles: ' + SITE + '/my#buy').catch(() => {});
}
return bonus;
}
@@ -134,7 +120,7 @@ async function tick() {
if (isWednesday(now - 86400000) && wed >= c.start && !S.sent['wrap:' + wed] && await claimOnce('wed:wrap:' + wed)) {
S.sent['wrap:' + wed] = now; save();
const st = stats(wed); const top = await topLines(wed);
X.telegram('\u{1F3C1} <b>Wired Wednesday wrap-up</b> (' + labelOf(wed) + ')\n<b>' + st.packs + ' packs</b> from ' + st.buyers + ' buyers · $' + st.usd.toFixed(0) + ' in ad packages · <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members · ' + st.bonusCredits.toLocaleString() + ' bonus credits wired into ' + st.visits.toLocaleString() + ' verified visits'
X.telegram('\u{1F3C1} <b>Wired Wednesday wrap-up</b> (' + labelOf(wed) + ')\n<b>' + st.packs + ' packs</b> from ' + st.buyers + ' buyers · $' + st.usd.toFixed(0) + ' in ad packages · <b>' + st.polPaid.toFixed(2) + ' POL</b> paid to members · ' + st.bonusCredits.toLocaleString() + ' bonus credits wired in'
+ (top.length ? '\nBiggest lines today: ' + top.map(t => t.who + ' (' + t.packs + ')').join(', ') : '')
+ '\nNext one is a week away: ' + SITE + '/my#buy').catch(() => {});
}
@@ -149,13 +135,13 @@ async function topLines(dayKey) {
return out;
}
function noticeText(c) {
return 'Tomorrow is Wired Wednesday on InstantAdPay.\n\nAny ad package of $' + (c.minCents / 100) + ' or more bought on Wednesday (Central time, midnight to midnight) earns +' + c.pct + '% bonus credits, and here is the twist: the bonus is wired straight into a verified-visits campaign pointed at your invite link. Real people, on your page, before you close the tab. Nothing to set up, nothing to claim.\n\nYour pack still pays your sponsor line the second it clears, and your line’s packs pay you.\n\nLine up your pack: ' + SITE + '/my#buy\nHow it works: ' + SITE + '/wednesday';
return 'Tomorrow is Wired Wednesday on InstantAdPay.\n\nAny ad package of $' + (c.minCents / 100) + ' or more bought on Wednesday (Central time, midnight to midnight) earns +' + c.pct + '% bonus credits, wired into your balance the second the pack settles. They are purchased-grade, so they run on any format you like, login ads included. Nothing to set up, nothing to claim.\n\nYour pack still pays your sponsor line the second it clears, and your line’s packs pay you.\n\nLine up your pack: ' + SITE + '/my#buy\nHow it works: ' + SITE + '/wednesday';
}
function headsUpText(c) {
return '\u{26A1} <b>Tomorrow is Wired Wednesday.</b> Any ad package from $' + (c.minCents / 100) + ' up bought on Wednesday (midnight to midnight, US Central) earns <b>+' + c.pct + '% credits</b>, wired straight into a verified-visits campaign for your invite link, running the moment it settles. Line up your pack tonight so you are ready at midnight: ' + SITE + '/wednesday';
return '\u{26A1} <b>Tomorrow is Wired Wednesday.</b> Any ad package from $' + (c.minCents / 100) + ' up bought on Wednesday (midnight to midnight, US Central) earns <b>+' + c.pct + '% credits</b>, wired into your balance the second it settles and good for any format. Line up your pack tonight so you are ready at midnight: ' + SITE + '/wednesday';
}
function kickoffText(c) {
return '\u{26A1} <b>It’s Wired Wednesday.</b> Any ad package from $' + (c.minCents / 100) + ' up earns <b>+' + c.pct + '% credits</b> today, wired straight into a verified-visits campaign for your invite link, running before you close the tab. Every pack pays its sponsor line in the same transaction. Buy yours: ' + SITE + '/my#buy';
return '\u{26A1} <b>It’s Wired Wednesday.</b> Any ad package from $' + (c.minCents / 100) + ' up earns <b>+' + c.pct + '% credits</b> today, wired into your balance the second it settles, good for any format including login ads. Every pack pays its sponsor line in the same transaction. Buy yours: ' + SITE + '/my#buy';
}
// on-site notice + email to every active member (quiet 45+ days skipped, drip unsubscribes honoured)
async function broadcast(subject, text) {