Wired Wednesday: configurable Tuesday notice hour + optional Tuesday Telegram heads-up
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+8
-2
@@ -37,6 +37,8 @@ function cfg() {
|
||||
minCents: Math.max(0, Number(c.wednesdayMinCents) || 1000),
|
||||
start: String(c.wednesdayStart || '2026-09-30'),
|
||||
notice: String(c.wednesdayNotice || '0') === '1',
|
||||
noticeHour: Math.min(23, Math.max(0, Number(c.wednesdayNoticeHour == null ? 18 : c.wednesdayNoticeHour) || 0)), // Central hour the Tuesday notice + email go out (Marty 09-29: earlier than 6 PM)
|
||||
tuePost: String(c.wednesdayTuePost || '0') === '1', // also a Tuesday heads-up post to Telegram at the notice hour
|
||||
kick: String(c.wednesdayKick || '0') === '1',
|
||||
};
|
||||
}
|
||||
@@ -118,8 +120,9 @@ async function tick() {
|
||||
const c = cfg(); if (!c.on) return;
|
||||
const now = Date.now(); const day = dayOf(now); const wd = weekdayOf(now); const h = hourOf(now);
|
||||
const next = nextWednesday(now);
|
||||
if (c.notice && wd === 'Tue' && h >= 18 && next && !S.sent['tue:' + next] && await claimOnce('wed:tue:' + next)) {
|
||||
if (c.notice && wd === 'Tue' && h >= c.noticeHour && next && !S.sent['tue:' + next] && await claimOnce('wed:tue:' + next)) {
|
||||
S.sent['tue:' + next] = now; save();
|
||||
if (c.tuePost) X.telegram(headsUpText(c)).catch(() => {});
|
||||
await broadcast('Tomorrow is Wired Wednesday', noticeText(c));
|
||||
}
|
||||
if (c.kick && wd === 'Wed' && h >= 9 && day >= c.start && !S.sent['kick:' + day] && await claimOnce('wed:kick:' + day)) {
|
||||
@@ -148,6 +151,9 @@ async function topLines(dayKey) {
|
||||
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';
|
||||
}
|
||||
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';
|
||||
}
|
||||
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';
|
||||
}
|
||||
@@ -164,6 +170,6 @@ async function broadcast(subject, text) {
|
||||
return n;
|
||||
}
|
||||
// what Marty reviews before switching the notice and kickoff on
|
||||
function previews() { const c = cfg(); return { notice: { subject: 'Tomorrow is Wired Wednesday', text: noticeText(c) }, kickoff: kickoffText(c).replace(/<[^>]+>/g, '') }; }
|
||||
function previews() { const c = cfg(); return { notice: { subject: 'Tomorrow is Wired Wednesday', text: noticeText(c) }, headsUp: headsUpText(c).replace(/<[^>]+>/g, ''), kickoff: kickoffText(c).replace(/<[^>]+>/g, ''), noticeHour: c.noticeHour, tuePost: c.tuePost }; }
|
||||
|
||||
module.exports = { init, cfg, view, stats, onEvent, tick, liveNow, nextWednesday, isWednesday, labelOf, previews };
|
||||
|
||||
Reference in New Issue
Block a user