diff --git a/wednesday.js b/wednesday.js
index 08eb7fc..93030e3 100644
--- a/wednesday.js
+++ b/wednesday.js
@@ -130,12 +130,21 @@ async function tick() {
const wed = dayOf(now - 86400000);
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 st = stats(wed); const top = await topLines(wed);
X.telegram('\u{1F3C1} Wired Wednesday wrap-up (' + labelOf(wed) + ')\n' + st.packs + ' packs from ' + st.buyers + ' buyers · $' + st.usd.toFixed(0) + ' in ad packages · ' + st.polPaid.toFixed(2) + ' POL paid to members · ' + st.bonusCredits.toLocaleString() + ' bonus credits wired into ' + st.visits.toLocaleString() + ' verified visits'
+ + (top.length ? '\nBiggest lines today: ' + top.map(t => t.who + ' (' + t.packs + ')').join(', ') : '')
+ '\nNext one is a week away: ' + SITE + '/my#buy').catch(() => {});
}
}
}
+// most packs bought by a sponsor's directs on a day (the line that pushed hardest), same as Friday's wrap-up
+async function topLines(dayKey) {
+ const by = new Map();
+ for (const ev of purchasesOn(dayKey)) { let sp = 0; try { const m = await X.chain.member(ev.buyerId); sp = m && m.sponsorId ? Number(m.sponsorId) : 0; } catch (e) {} if (!sp) continue; by.set(sp, (by.get(sp) || 0) + 1); }
+ const rows = [...by.entries()].sort((a, b) => b[1] - a[1]).slice(0, 3);
+ const out = []; for (const [id, packs] of rows) { let who = '#' + id; try { const a = await X.accounts.byMemberId(id); if (a && a.username) who = '@' + a.username; } catch (e) {} out.push({ memberId: id, who, packs }); }
+ 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';
}