Daily LinkSpin snapshot card (Marty 2026-11-02): spin links served, Banner Spin views, zone views, page views and leads, then sign-ups, purchases and POL paid, posted once a day to the LinkSpin Support topic (new target 'support', settings telegramSupportChatId/TopicId); window24() helpers on rotator, bannerspin, zones and pages; POST /api/admin/snapshot/send takes {target} for a one-off
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -139,6 +139,11 @@ function adminAll() {
|
||||
return { id: z.id, name: z.name, site: z.site, size: z.size, tier: tierOf(z), active: !!z.active, paused: !!z.adminPaused, note: z.adminNote || '', owner: z.owner, created: z.created,
|
||||
views30: imps.length, viewable30: seen, viewablePct: imps.length ? Math.round(seen / imps.length * 100) : null, clicks30: imps.filter(i => i.k).length, offsite30: imps.filter(i => i.off).length, credits: z.credits || 0, status: st.state, statusLabel: st.label, lastSeen: last[z.id] || 0 }; });
|
||||
}
|
||||
// site-wide figures for the daily snapshot: real impressions inside the `since` window and new zones
|
||||
function window24(since) {
|
||||
const imps = J.db.imps.filter(i => i.ts >= since && !i.bot);
|
||||
return { zones: J.db.zones.length, created: J.db.zones.filter(z => (z.created || 0) >= since).length, views: imps.length, viewable: imps.filter(i => i.ok).length };
|
||||
}
|
||||
function totals() { const since = Date.now() - 30 * DAY; const imps = J.db.imps.filter(i => i.ts >= since && !i.bot); return { zones: J.db.zones.length, views30: imps.length, viewable30: imps.filter(i => i.ok).length, clicks30: imps.filter(i => i.k).length, nas30: imps.filter(i => i.nas).length, credits: J.db.zones.reduce((n, z) => n + (z.credits || 0), 0) }; }
|
||||
// -- publisher program totals (Reports screen + the public strip): the last N days, Central days, per day and per zone.
|
||||
// "live" = switched on, not admin-paused, and seen by a real visitor inside the window. Credits are read from the pay log
|
||||
@@ -164,4 +169,4 @@ function publisherPublic() {
|
||||
rates: { viewsPerCredit: s.viewsPerCredit, nasViewsPerCredit: s.nasViewsPerCredit, nasViewsPerCreditVerified: s.nasViewsPerCreditVerified, capPerVisitorDay: s.capPerVisitorDay }, warmup: WARMUP, holdRatio: HOLD_RATIO, updated: Date.now() };
|
||||
pubCache = { ts: Date.now(), data }; return data;
|
||||
}
|
||||
module.exports = { init, SIZES, NAS_SIZES, TIERS, WARMUP, HOLD_RATIO, settings, tierOf, rateFor, nasFrame, list, create, update, tag, serve, seen, click, totals, publisherTotals, publisherPublic, adminList, adminSet, adminAll };
|
||||
module.exports = { init, SIZES, NAS_SIZES, TIERS, WARMUP, HOLD_RATIO, settings, tierOf, rateFor, nasFrame, list, create, update, tag, serve, seen, click, totals, window24, publisherTotals, publisherPublic, adminList, adminSet, adminAll };
|
||||
|
||||
Reference in New Issue
Block a user