b062939577
chainskus.js reads skus(1) every 60 s and keeps C.boost in step (BOOST_VIEWS stays the normal 500 as normalViews), so a $5 Boost shows 750 once the owner signs setSku and 500 before or after; crediting already follows the Purchase event's views. common.js rewrites the pages' static '500 guaranteed views' copy to the live number only when the chain differs. weekend.js: the Fri 11-27 00:00 CT to Tue 12-01 00:00 CT gate (WEEKEND_NOW test clock) for the dated chatbot fact; the ribbon line (netdeals.setLocal) only exists while the chain really holds the weekend Boost. chatcore render hook, live intro. qa/weekend.test.mjs 18 pass, chatbot 206, smoke 197. common.js?v=9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
1.6 KiB
JavaScript
20 lines
1.6 KiB
JavaScript
// Network Weekend (Marty 2026-11-17): Black Friday to Cyber Monday 2026, Fri 11-27 00:00 CT to Tue 12-01 00:00 CT, exact instants
|
|
// (late November is CST, UTC-6). On this site the deal is the owner's VABShop setSku: a $5 Boost carries 750 views instead of 500.
|
|
// Nothing here changes what a Boost credits (the Purchase event's views do, shop.js); this only decides what the ribbon and the
|
|
// chatbot say, always from the live chain value (chainskus.js syncBoost), so a late or early signature never shows a wrong number.
|
|
// WEEKEND_NOW (ISO time) is the test clock: tests only, never set it on the server.
|
|
'use strict';
|
|
const START = Date.parse('2026-11-27T06:00:00Z'); // Fri 11-27 00:00 CT
|
|
const END = Date.parse('2026-12-01T06:00:00Z'); // Tue 12-01 00:00 CT
|
|
function now() { const o = process.env.WEEKEND_NOW; const t = o ? Date.parse(o) : NaN; return Number.isNaN(t) ? Date.now() : t; }
|
|
function on(ms) { ms = ms == null ? now() : ms; return ms >= START && ms < END; }
|
|
// more views than normal on chain right now (the owner has switched the SKU)
|
|
const bonus = C => C.boost.normalViews != null && C.boost.views > C.boost.normalViews;
|
|
// the ribbon's ViralAdBlitz line: only when the chain really holds the weekend Boost; otherwise no line rather than a wrong one
|
|
function dealLine(C, d) {
|
|
if (!bonus(C)) return null;
|
|
const x = Object.assign({}, d, { text: 'A $' + C.boost.usd + ' Boost carries ' + C.boost.views.toLocaleString('en-US') + ' guaranteed views instead of ' + C.boost.normalViews.toLocaleString('en-US') + '.' });
|
|
delete x.byDay; return x;
|
|
}
|
|
module.exports = { START, END, now, on, bonus, dealLine };
|