From 5a522f0ede09eeb8c39bb74951ba62b984e40556 Mon Sep 17 00:00:00 2001 From: martbost Date: Thu, 1 Oct 2026 08:43:22 -0500 Subject: [PATCH] Weekly member email as sectioned HTML (plain-text twin kept); PassiveDrip one-tap hand-off (inert until PD_SSO_SECRET) - coach.js: weeklyDigest() builds one card per topic (credits, streak, contest, tank, team) with the key number up front and one button; mailer.send takes optional html - server.js: /api/my/passivedrip mints a signed hand-off (memberId, email, username, verified wallet, sponsor email); Games card for PassiveDrip (admin preview until gamesLive includes passivedrip) with the member's own coins line via the bridge 'member' lookup; sign-in return path - my.js: card button label, return redirect; v=20261001b Co-Authored-By: Claude Opus 5.5 --- coach.js | 143 ++++++++++++++++++++--------- mailer.js | 6 +- pdsync.js | 8 +- public/assets/my.js | 3 +- public/assets/passivedrip-card.svg | 17 ++++ public/my.html | 2 +- server.js | 32 ++++++- 7 files changed, 160 insertions(+), 51 deletions(-) create mode 100644 public/assets/passivedrip-card.svg diff --git a/coach.js b/coach.js index 0e47c6f..f08f784 100644 --- a/coach.js +++ b/coach.js @@ -205,6 +205,103 @@ async function linkStats(email) { return { angles: Object.values(rows), sources, totalViews: views.length, totalJoins: joined.length }; } +// ---- the weekly member email (Marty, 2026-09-14; reformatted 2026-10-01 because one long text block was hard to read): +// one section per topic, each with a heading, the number that matters up front and ONE button. Sent as HTML with a +// plain-text twin built from the same sections. +const SITE = 'https://instantadpay.com'; +const escH = v => String(v == null ? '' : v).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); +const n0 = v => Number(v || 0).toLocaleString('en-US'); +async function weeklyDigest(acct, view, lbWeek, tankN, now) { + const name = acct.username ? '@' + acct.username : 'there'; + const S = []; // { title, big, bigLabel, lines[], rows[[label, value]], quotes[{to, text}], button{label, url} } + // credits: they sit on positions and each campaign pays from one, so the pooled total alone misleads + // members with linked positions (Jim Watts, 2026-09-27: "561 unspent" but a top-up allowed 19) + try { + const ids = [acct.memberId, ...(await accounts.positions(acct.email)).map(p => p.memberId)].filter(Boolean); + const bal = await X.ads.balances(ids, acct.email); + if (bal.available > 0) { + const onPos = (bal.per || []).filter(p => p.avail > 0).sort((a, b) => b.avail - a.avail); + const loose = (bal.credited || 0) + (bal.earned || 0); + const sec = { title: 'Ad credits ready to use', big: n0(bal.available), bigLabel: 'credits not running yet', lines: [], button: { label: 'Start a campaign', url: SITE + '/my#campaigns' } }; + if (onPos.length > 1) { + sec.rows = onPos.map(p => ['Position #' + p.memberId, n0(p.avail)]); + if (loose) sec.rows.push(['Any position can use', n0(loose)]); + sec.lines.push('Each campaign spends from one position. Start from #' + onPos[0].memberId + ' to use the most credits at once.'); + } + sec.lines.push('Point the campaign at your invite link so the views bring people to you.'); + S.push(sec); + } else if (bal.inCampaigns > 0) S.push({ title: 'Ad credits', big: n0(bal.inCampaigns), bigLabel: 'credits working in live campaigns', lines: ['Everything you have is running. Nice.'] }); + } catch (e) {} + // streak + try { + const st = await X.ads.viewStatus(acct.email); + if (st.streakDay > 1) S.push({ title: 'Daily claim streak', big: 'Day ' + st.streakDay, bigLabel: 'of your streak. Today’s claim pays ' + n0(st.claimCredits) + ' credits.', lines: ['Miss a day and the streak starts over.'], button: { label: 'Claim today', url: SITE + '/my#earn' } }); + else S.push({ title: 'Free daily credits', lines: ['View five ads and claim once a day. The claim grows 5, 7, 10 credits, then 25 on every seventh day in a row.'], button: { label: 'Start today', url: SITE + '/my#earn' } }); + } catch (e) {} + // contest + let first = false; + if (lbWeek && lbWeek.top) { + const me = lbWeek.top.find(r => r.name === '@' + acct.username) || null; + let mine = me; if (!mine) { try { mine = (await X.lb().view('week', acct.email)).me; } catch (e) {} } + first = !!(lbWeek.top.length && lbWeek.top[0].name === '@' + acct.username); + const sec = { title: 'This week’s referral contest', lines: [], button: { label: 'See the leaderboard', url: SITE + '/leaderboard' } }; + if (lbWeek.prize) sec.intro = 'Prizes: ' + lbWeek.prize + '.'; + if (lbWeek.top.length) sec.rows = lbWeek.top.slice(0, 3).map(r => [r.rank + '. ' + r.name, r.sales + ' sold']); + else sec.lines.push('No sales yet. The first one takes the top spot.'); + if (mine) { sec.big = '#' + mine.rank; sec.bigLabel = 'is your place, with ' + mine.sales + ' sold'; } + else sec.lines.push('You are not on the board yet. One $20 package bought by someone you sponsor puts you there.'); + S.push(sec); + } + // tank + if (tankN > 0 && acct.memberId) S.push({ title: 'Holding tank', big: n0(tankN), bigLabel: 'member' + (tankN === 1 ? '' : 's') + ' waiting for a sponsor', lines: ['Adopt one from My line and they join your team.'], button: { label: 'Adopt a member', url: SITE + '/my#line' } }); + // line (sponsors only) + if (view.directs.length) { + const week = view.directs.filter(d => now - d.joined < 7 * DAY).length; + const sec = { title: 'Your team', rows: [['Direct members', n0(view.directs.length)], ['Joined this week', n0(week)], ['Gone quiet', n0(view.stalled)]], lines: [], button: { label: 'Open My line', url: SITE + '/my#line' } }; + const q = view.directs.filter(d => d.stalled).slice(0, 3).map(d => ({ to: d.name, text: d.say.replace('{{name}}', d.name.replace(/^@/, '')) })); + if (q.length) { sec.lines.push('A quick message gets most people moving again. Copy these:'); sec.quotes = q; } + S.push(sec); + } + const subject = first ? 'You are #1 this week on InstantAdPay' : 'Your week on InstantAdPay: credits, streak, contest'; + const tip = { text: 'Short on time? The twenty-minute day: claim your set, message one person on your team, check the tank, start one new conversation.', link: SITE + '/blog/the-twenty-minute-day' }; + const legal = 'No income is guaranteed. Credits are advertising, not money.'; + + // plain text twin + const T = ['Hi ' + name + ', here is your week on InstantAdPay.', '']; + for (const s of S) { + T.push(s.title.toUpperCase()); + if (s.big) T.push(s.big + ' ' + s.bigLabel); + if (s.intro) T.push(s.intro); + for (const r of s.rows || []) T.push(' ' + r[0] + ': ' + r[1]); + for (const l of s.lines) T.push(l); + for (const q of s.quotes || []) T.push(' To ' + q.to + ': "' + q.text + '"'); + if (s.button) T.push(s.button.label + ': ' + s.button.url); + T.push(''); + } + T.push(tip.text + ' ' + tip.link, '', 'InstantAdPay · ' + SITE + '/my', legal); + + // html + const btn = b => '' + escH(b.label) + ''; + const card = s => '
' + + '
' + escH(s.title) + '
' + + (s.big ? '
' + escH(s.big) + ' ' + escH(s.bigLabel) + '
' : '') + + (s.intro ? '

' + escH(s.intro) + '

' : '') + + (s.rows ? '' + s.rows.map(r => '').join('') + '
' + escH(r[0]) + '' + escH(r[1]) + '
' : '') + + s.lines.map(l => '

' + escH(l) + '

').join('') + + (s.quotes || []).map(q => '
To ' + escH(q.to) + '
' + escH(q.text) + '
').join('') + + (s.button ? '
' + btn(s.button) + '
' : '') + + '
'; + const html = '' + + '
' + + '' + + '' + + S.map(card).join('') + + '' + + '' + + '
Your week on InstantAdPay
Hi ' + escH(name) + ', here is where things stand.
' + escH(tip.text) + ' Read how
InstantAdPay · ' + 'instantadpay.com/my
' + escH(legal) + '
'; + return { subject, text: T.join('\n'), html, sections: S }; +} + // ---- automatic nudges to stalled members + weekly digest to sponsors ---- let ticking = false; const NUDGE_GAP = 5 * DAY; @@ -242,48 +339,8 @@ async function nudgeTick() { // audience: sponsors with directs (as before) unless the admin switched the weekly on for every member const everyone = X.siteConfig && String(X.siteConfig().memberWeeklyEmail || '0') === '1'; if (!everyone && !view.directs.length) { await impl().setDigest(acct.email, now); continue; } - const name = acct.username ? '@' + acct.username : 'there'; - const parts = ['Hi ' + name + ', your week on InstantAdPay:']; - // credits - try { - const ids = [acct.memberId, ...(await accounts.positions(acct.email)).map(p => p.memberId)].filter(Boolean); - const bal = await X.ads.balances(ids, acct.email); - if (bal.available > 0) { - // credits sit on positions and each campaign pays from one, so a pooled total alone misleads - // members with linked positions (Jim Watts, 2026-09-27: "561 unspent" but a top-up allowed 19) - const onPos = (bal.per || []).filter(p => p.avail > 0).sort((a, b) => b.avail - a.avail); - const loose = (bal.credited || 0) + (bal.earned || 0); - let where = ''; - if (onPos.length > 1) where = ' They are spread across your positions: ' + onPos.map(p => '#' + p.memberId + ' has ' + p.avail.toLocaleString()).join(', ') + (loose ? ', plus ' + loose.toLocaleString() + ' that any position can use' : '') + '. Each campaign pays from one position, so start a new campaign from #' + onPos[0].memberId + ' to use the most in one go.'; - parts.push('- You have ' + bal.available.toLocaleString() + ' ad credits sitting unspent. That is ' + bal.available.toLocaleString() + ' cents of delivery doing nothing.' + where + ' Campaigns > New campaign, point it at your invite link: https://instantadpay.com/my#campaigns'); - } - else if (bal.inCampaigns > 0) parts.push('- All ' + bal.inCampaigns.toLocaleString() + ' of your credits are working in live campaigns. Good.'); - } catch (e) {} - // streak - try { - const st = await X.ads.viewStatus(acct.email); - if (st.streakDay > 1) parts.push('- Your claim streak is on day ' + st.streakDay + '. Today\'s claim pays ' + (st.claimCredits || 0) + ' credits; miss a day and it restarts at 5.'); - else parts.push('- Five ads and a claim a day is the free way in: 5, 7, 10, then 25 credits every seventh day in a row: https://instantadpay.com/my#earn'); - } catch (e) {} - // contest - if (lbWeek && lbWeek.top) { - const me = lbWeek.top.find(r => r.name === '@' + acct.username) || null; - let mine = me; if (!mine) { try { mine = (await X.lb().view('week', acct.email)).me; } catch (e) {} } - parts.push('- Referral contest this week (' + (lbWeek.prize || 'credits to the top 3') + '): ' + (lbWeek.top.length ? lbWeek.top.slice(0, 3).map(r => r.rank + '. ' + r.name + ' (' + r.sales + ' sold)').join(', ') : 'no sales yet, first sale takes the top spot') + '.' - + (mine ? ' You are #' + mine.rank + ' with ' + mine.sales + ' sold.' : ' You are not on the board yet; one $20 package bought by someone you sponsor puts you there.') + ' https://instantadpay.com/leaderboard'); - } - // tank - if (tankN > 0 && acct.memberId) parts.push('- ' + tankN + ' member' + (tankN === 1 ? ' is' : 's are') + ' waiting for a sponsor in the holding tank. Adopt one from My line: https://instantadpay.com/my#line'); - // line (sponsors only) - if (view.directs.length) { - const week = view.directs.filter(d => now - d.joined < 7 * DAY).length; - parts.push('- Your line: ' + view.directs.length + ' direct' + (view.directs.length === 1 ? '' : 's') + ', ' + week + ' joined this week, ' + view.stalled + ' gone quiet.'); - const actions = view.directs.filter(d => d.stalled).slice(0, 3).map(d => ' Message ' + d.name + ': "' + d.say.replace('{{name}}', d.name.replace(/^@/, '')) + '"'); - if (actions.length) parts.push(actions.join('\n')); - } - parts.push('\nTwenty minutes, in order: the set, one message to your line, the tank, one conversation outward. https://instantadpay.com/blog/the-twenty-minute-day\n\nInstantAdPay · https://instantadpay.com/my\nNo income is guaranteed. Credits are advertising, not money.'); - const subject = lbWeek && lbWeek.top && lbWeek.top.length && lbWeek.top[0].name === '@' + acct.username ? 'You are #1 this week on InstantAdPay' : 'Your week on InstantAdPay: credits, streak, contest'; - try { await mailer.send(acct.email, subject, parts.join('\n')); digests += 1; } catch (e) { console.error('digest', acct.email, e.message); } + const { subject, text, html } = await weeklyDigest(acct, view, lbWeek, tankN, now); + try { await mailer.send(acct.email, subject, text, html); digests += 1; } catch (e) { console.error('digest', acct.email, e.message); } await impl().setDigest(acct.email, now); if (digests >= 30) break; } @@ -297,4 +354,4 @@ function init(opts) { X = arguments[0] || {}; J.load(); } async function viewsSince(since) { return impl().viewsSince(since); } -module.exports = { init, RUNGS, rungFor, describe, coachView, prospects, saveProspect, removeProspect, STATUSES, recordView, linkStats, nudgeTick, recordClick, clickSources, refHost, viewsSince }; +module.exports = { init, weeklyDigest, RUNGS, rungFor, describe, coachView, prospects, saveProspect, removeProspect, STATUSES, recordView, linkStats, nudgeTick, recordClick, clickSources, refHost, viewsSince }; diff --git a/mailer.js b/mailer.js index 96fd388..5df03c0 100644 --- a/mailer.js +++ b/mailer.js @@ -15,13 +15,15 @@ function key() { } function hasKey() { return !!key(); } -function send(to, subject, text) { +function send(to, subject, text, html) { // html optional (2026-10-01): sent alongside the plain text, never instead of it return new Promise((resolve, reject) => { + const content = [{ type: 'text/plain', value: text }]; + if (html) content.push({ type: 'text/html', value: html }); const body = JSON.stringify({ personalizations: [{ to: [{ email: to }] }], from: FROM, subject, - content: [{ type: 'text/plain', value: text }] + content }); const req = https.request({ hostname: 'api.sendgrid.com', path: '/v3/mail/send', method: 'POST', headers: { Authorization: 'Bearer ' + key(), 'Content-Type': 'application/json', diff --git a/pdsync.js b/pdsync.js index e281648..c25b994 100644 --- a/pdsync.js +++ b/pdsync.js @@ -62,4 +62,10 @@ async function sync() { return t; } function status() { return { enabled: enabled(), bridge: enabled() ? process.env.PD_BRIDGE_URL.replace(/\?.*$/, '') : null, last: S.last, tracked: Object.keys(S.served).length }; } -module.exports = { enabled, init, sync, status, listing }; +// the member's own PassiveDrip line for the Games card (2026-10-01): bridge action 'member', read only +async function member(memberId, email) { + if (!enabled()) return null; + const j = await bridge('member', 'POST', { memberId: Number(memberId) || 0, email: String(email || '').toLowerCase() }); + return j && j.ok ? j : null; +} +module.exports = { enabled, init, sync, status, listing, member }; diff --git a/public/assets/my.js b/public/assets/my.js index ef8d675..fed15d5 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -823,6 +823,7 @@ } // came from a Drip Runner share link: once they have a username, straight back into the game (2026-09-30) if (me.returnTo === 'driprunner' && !render.toGame) { render.toGame = true; location.href = '/api/my/driprunner'; return; } + if (me.returnTo === 'passivedrip' && !render.toGame) { render.toGame = true; location.href = '/api/my/passivedrip'; return; } // PassiveDrip sent them here to sign in (2026-10-01) // arrived from an invite page: run the welcome tour and login ad once if (/[?&]welcome=1/.test(location.search) && !render.welcomed) { render.welcomed = true; @@ -1643,7 +1644,7 @@ let g = null; try { g = await (await fetch('/api/my/games')).json(); } catch (e) {} const list = (g && g.games) || []; if (!list.length) { el.innerHTML = '

No games are open yet. Check back soon.

'; return; } - el.innerHTML = list.map(x => '
' + esc(x.tag || '') + '

' + esc(x.name) + (x.preview ? 'preview, not live' : '') + '

' + esc(x.blurb) + '

' + (x.progress && x.progress.line ? '
' + esc(x.progress.line) + '
' : '') + '

Pays: ' + esc(x.pays || 'POL') + '

Play
').join(''); + el.innerHTML = list.map(x => '
' + esc(x.tag || '') + '

' + esc(x.name) + (x.preview ? 'preview, not live' : '') + '

' + esc(x.blurb) + '

' + (x.progress && x.progress.line ? '
' + esc(x.progress.line) + '
' : '') + '

Pays: ' + esc(x.pays || 'POL') + '

' + esc(x.cta || 'Play') + '
').join(''); } async function loadReturnCard() { const card = $('phReturn'); if (!card) return; diff --git a/public/assets/passivedrip-card.svg b/public/assets/passivedrip-card.svg new file mode 100644 index 0000000..0f2c397 --- /dev/null +++ b/public/assets/passivedrip-card.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + PassiveDrip + Faucet + games, paid in POL + diff --git a/public/my.html b/public/my.html index 86e0e6e..5b00f3d 100644 --- a/public/my.html +++ b/public/my.html @@ -1099,7 +1099,7 @@ - + diff --git a/server.js b/server.js index ed7b443..148bfe5 100644 --- a/server.js +++ b/server.js @@ -1255,8 +1255,22 @@ function GAMES() { art: DR_URL() + '/badges/ch5.jpg', play: '/api/my/driprunner', pays: 'POL to your wallet at 0.25', progress: drProgress }, { slug: 'polhunter', name: 'PolHunter', tag: 'Scavenger hunt', blurb: 'Hunt hidden codes on sites across the network. Every find drips POL straight to your wallet.', art: 'https://polhunter.com/img/hero-800.webp', play: '/api/my/polhunter', pays: 'POL per find' }, + { slug: 'passivedrip', name: 'PassiveDrip', tag: 'Faucet + games', blurb: 'Claim the faucet, view paid-to-click ads, roll the bonus and play the mini games for coins. One tap signs you in with this account, no new password.', + art: '/assets/passivedrip-card.svg', play: '/api/my/passivedrip', cta: 'Open', pays: 'POL to your wallet at 2,000 coins ($1)', progress: pdProgress }, ]; } +// -- PassiveDrip hand-off (2026-10-01): same token shape as Drip Runner, its own secret (PD_SSO_SECRET, also stored in +// PassiveDrip's site_config iap_sso_secret). PassiveDrip signs the member in or creates the account, carries the sponsor +// over by email, and OFFERS the wallet with one confirm tap; it never writes or overwrites a payout address silently. +const PD_SECRET = () => String(process.env.PD_SSO_SECRET || '').trim(); +const PD_URL = () => String(process.env.PD_URL || 'https://passivedrip.com').replace(/\/+$/, ''); +function pdMint(claims) { const payload = JSON.stringify(Object.assign({ aud: 'passivedrip', iat: Date.now(), exp: Date.now() + 5 * 60000, nonce: crypto.randomBytes(16).toString('hex') }, claims)); return drB64u(payload) + '.' + drB64u(crypto.createHmac('sha256', PD_SECRET()).update(payload).digest()); } +async function pdProgress(memberId, email) { + const j = await pdsync.member(memberId, email); if (!j) return null; + if (!j.exists) return { line: 'No PassiveDrip account yet. Open it and one is made for you.' }; + const coins = Math.floor(Number(j.coins) || 0); + return { line: '@' + j.username + ' · ' + coins.toLocaleString('en-US') + ' of ' + Number(j.threshold || 2000).toLocaleString('en-US') + ' coins' + (j.hasWallet ? '' : ' · no payout wallet yet') + (j.paidPol ? ' · ' + Number(j.paidPol).toFixed(2) + ' POL paid out' : '') }; +} // the player's own line on the Drip Runner card, read from the game with a signed request async function drProgress(memberId) { if (DR_SECRET().length < 32) return null; @@ -1636,7 +1650,7 @@ const server = http.createServer(async (req, res) => { let memberId = 0; if (r.account.address) { try { memberId = await chain.memberIdByAccount(r.account.address); } catch (err) {} } const token = await auth.mintSession({ email: r.account.email, address: r.account.address, memberId }); - return json(res, 200, { ok: true, account: r.account, created: !!r.created, next: parseCookies(req)['iap.return'] === 'driprunner' ? '/api/my/driprunner' : null }, { 'Set-Cookie': auth.sessionCookie(token) }); // next: Drip Runner sent them here to sign in (2026-09-30) + return json(res, 200, { ok: true, account: r.account, created: !!r.created, next: ({ driprunner: '/api/my/driprunner', passivedrip: '/api/my/passivedrip' })[parseCookies(req)['iap.return']] || null }, { 'Set-Cookie': auth.sessionCookie(token) }); // next: Drip Runner sent them here to sign in (2026-09-30) } // -- wallet auth: link-to-account when an email session exists, or @@ -1715,7 +1729,7 @@ const server = http.createServer(async (req, res) => { const _defSpon = Number(siteConfig().defaultSponsorId) || 1; if (!sponsorId && memberId !== _defSpon) sponsorId = _defSpon; // orphan fallback → #1 (never self-sponsor) if (memberId && acct && acct.memberId !== memberId) accounts.setMemberId(acct.email, memberId).catch(() => {}); - const out = { signedIn: true, returnTo: ['polhunter', 'driprunner'].includes(parseCookies(req)['iap.return']) ? parseCookies(req)['iap.return'] : null, sponsorBlocked, sponsorRouted, sponsorName: spdMe.name || null, email: s.email || (acct && acct.email) || null, + const out = { signedIn: true, returnTo: ['polhunter', 'driprunner', 'passivedrip'].includes(parseCookies(req)['iap.return']) ? parseCookies(req)['iap.return'] : null, sponsorBlocked, sponsorRouted, sponsorName: spdMe.name || null, email: s.email || (acct && acct.email) || null, address: s.address || (acct && acct.address) || null, memberId, username: (acct && acct.username) || null, refCode: (acct && acct.code) || null, sponsorId, @@ -2455,6 +2469,18 @@ const server = http.createServer(async (req, res) => { sponsorRef: (acct && acct.sponsorRef) || null, joinedRef: (acct && acct.joinedRef) || null, joinedAt: (acct && acct.created) || null }); // the game credits referrals to the IAP sponsor res.writeHead(302, { Location: DR_URL() + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': 'iap.return=; Path=/; SameSite=Lax; Max-Age=0' + (IS_PROD ? '; Secure' : '') }); return res.end(); } + // -- PassiveDrip hand-off (2026-10-01): sign the member across; PassiveDrip verifies with the shared secret. + // wallet = the signature-verified main wallet (accounts.linkWallet runs only after /api/auth/verify), offered there, never imposed. + if (p === '/api/my/passivedrip' && req.method === 'GET') { + const s = await auth.fromRequest(req); + if (!s || !s.email) { res.writeHead(302, { Location: '/my', 'Set-Cookie': 'iap.return=passivedrip; Path=/; SameSite=Lax; Max-Age=1800' + (IS_PROD ? '; Secure' : ''), 'Cache-Control': 'no-store' }); return res.end(); } // sign in first, then straight across + if (PD_SECRET().length < 32) return json(res, 503, { error: 'PassiveDrip is not connected yet.' }); + const acct = await accounts.byEmail(s.email); + const memberId = (acct && acct.memberId) || s.memberId || 0; + let sponsorEmail = null; try { const up = await uplineSlides(s.email, 1); sponsorEmail = (up[0] && up[0].email) || null; } catch (e) {} + const tok = pdMint({ memberId: Number(memberId), email: String(s.email).toLowerCase(), username: (acct && acct.username) || null, wallet: (acct && acct.address) || null, sponsorEmail }); + res.writeHead(302, { Location: PD_URL() + '/iap-signin.php?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': 'iap.return=; Path=/; SameSite=Lax; Max-Age=0' + (IS_PROD ? '; Secure' : '') }); return res.end(); + } // -- Drip Runner refuel: a real verified visit (advertiser charged as usual); the player gets fuel, not credits if (p === '/api/refuel/open' && req.method === 'GET') { const r = drOpen(u.searchParams.get('t')); if (r.error) return json(res, 400, { error: r.error }); @@ -2521,7 +2547,7 @@ const server = http.createServer(async (req, res) => { for (const g of GAMES()) { const isLive = live.has(g.slug); if (!isLive && !admin) continue; const card = Object.assign({}, g, { live: isLive, preview: !isLive }); - if (g.progress && memberId) { try { card.progress = await g.progress(memberId); } catch (e) {} } + if (g.progress && (memberId || g.slug === 'passivedrip')) { try { card.progress = await g.progress(memberId, s.email); } catch (e) {} } out.push(card); } return json(res, 200, { games: out.map(g => { const c = Object.assign({}, g); if (typeof c.progress === 'function') delete c.progress; return c; }) });