ccfaacc935
Active members with their own paid package ($20+ InstantAdPay, $25+ LinkSpin via the refuel record) receive tank people in batches: Paid 10, Fueled 20 (counted refuel streak or a $50+ package), Twin Engine 25 (both engines this cycle or the top package, the live catalog's highest, $500 today), +5 per further consecutive refuel month up to 50. Every 2 days per sponsor, topped up to their size, dealt by rotation highest tier first from tank.adoptable() (grace, rule 3, LinkSpin adoptions respected), never self, own upline, adopted twice, flagged, spam, mistyped, erased or unsubscribed. Same tank.adopt path (sponsor change, chat, "X is now your sponsor" email, switch-on reminders); one notice per batch to the sponsor. Uncontacted after 7 days -> back to the tank as 'unreached' (not counted). Tank feed: payments-topic card + live toast, sponsor/count/level only. Member panel "How to get fed leads" (tankfeed.js). Every number is a site setting. 5xYourTeam draft gets its own cap (fiveXDraftCap, default 10): open draft picks only; plain adoptions, the 24-hour safety net and batches each count their own people. Admin: GET /api/admin/tank/batches/preview (read-only) + /api/admin/tank/batches. Chatbot: coming soon only. qa/tank-batch.test.mjs (60 checks) in run.sh member. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
3.2 KiB
JavaScript
40 lines
3.2 KiB
JavaScript
// "How to get fed leads" (holding tank batches, Marty 2026-11-15): the ladder and the member's own level and next step, on the
|
|
// Overview. Hidden while the tankBatches switch is off (/api/my/tank/feed answers { on:false }). Leads you can sponsor, never money.
|
|
(function () {
|
|
const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
const day = t => t ? new Date(t).toLocaleString('en-US', { weekday: 'short', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', timeZone: 'America/Chicago' }) + ' CT' : '';
|
|
function mount() {
|
|
let el = document.getElementById('tankFeedCard'); if (el) return el;
|
|
el = document.createElement('div'); el.className = 'card'; el.id = 'tankFeedCard'; el.hidden = true; el.setAttribute('data-jump', 'How to get fed leads');
|
|
const notice = document.getElementById('tankNotice'); const host = notice && notice.closest('.card');
|
|
const tankCard = document.getElementById('tankCard');
|
|
if (host && host.parentNode) host.parentNode.insertBefore(el, host.nextSibling);
|
|
else if (tankCard && tankCard.parentNode) tankCard.parentNode.insertBefore(el, tankCard);
|
|
else return null;
|
|
return el;
|
|
}
|
|
function html(v) {
|
|
const me = v.me || {};
|
|
const rows = (v.ladder || []).map(r => '<li><b>' + esc(r.level) + '</b>: ' + (r.level === 'Streak' ? 'up to ' : '') + r.size + ' people at a time, with ' + esc(r.how) + '</li>').join('');
|
|
const mine = me.level
|
|
? '<p>Your level: <b>' + esc(me.label || me.level) + '</b>, ' + me.size + ' people at a time' + (me.active ? '' : ' (sign in at least once a week to receive them)') + '.'
|
|
+ (me.open ? ' You are helping ' + me.open + ' from your batches right now.' : '') + (me.nextBatchAt ? ' Next batch from ' + esc(day(me.nextBatchAt)) + '.' : '') + '</p>'
|
|
: '<p>You are not on the ladder yet.</p>';
|
|
return '<div class="card-head"><h3>How to get fed leads</h3><span class="sub">people from the holding tank you can sponsor</span></div>'
|
|
+ '<p class="small">Members who joined with no sponsor wait in the holding tank. Active members who bought their own package receive a batch of them every ' + esc(v.everyDays) + ' days, and they become your referrals to welcome and help. These are leads you can sponsor: what happens next depends on your follow-up, and nothing here is a promise of income.</p>'
|
|
+ '<ul class="small" style="margin:6px 0 8px 18px;padding:0">' + rows + '</ul>' + mine
|
|
+ (me.next ? '<p class="small"><b>Next step:</b> ' + esc(me.next) + '</p>' : '')
|
|
+ '<p class="muted small">Say hello to each new person within ' + esc(v.followDays) + ' days (a chat, or Contacted them on their row in My line). Anyone you have not contacted by then goes back to the tank for another member.</p>';
|
|
}
|
|
async function load() {
|
|
try {
|
|
const v = await (await fetch('/api/my/tank/feed', { cache: 'no-store' })).json();
|
|
const el = mount(); if (!el) return;
|
|
if (!v || !v.on) { el.hidden = true; return; }
|
|
el.innerHTML = html(v); el.hidden = false;
|
|
} catch (e) {}
|
|
}
|
|
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', load); else load();
|
|
setInterval(load, 600000);
|
|
})();
|