"Use one of my spin links" on the text-ad form (Marty 2026-11-15): a member picks one of their own LinkSpin spin links as the ad link, so one free ad rotates clicks across every page they promote. Listed live from LinkSpin (GET /api/my/spins -> lstrack.spins, /api/partner/vab/links op 'spins'). A LinkSpin /r/<code> link on any LinkSpin host is accepted ONLY when LinkSpin confirms it is the signed-in member's own (lstrack.checkSpin): someone else's, a paused one, one with no active pages, or any while LinkSpin is not answering is refused; the network's fixed nw* links and /r/ links on other sites stay ordinary links; other shortener rules unchanged. A spin-link ad (ad.spin) never gets the "Track with LinkSpin" wrapper: /go/<ad> sends straight to the spin link, the checkbox is greyed with a note. LinkSpin hosts learned from every spins answer (warmed hourly by the sweep). Chatbot: CANNED spin-link + FACTS. my.js?v=7. Smoke 217 pass (14b2: foreign refused, own accepted), chatbot 206 pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+24
-2
@@ -29,13 +29,34 @@
|
||||
if (!ls || !ls.on) return '';
|
||||
const why = { off: 'Tracking is off for this ad: visitors go straight to your link.', macros: 'Your link has {clickid} or {placement} codes, so it goes out as it is (not through LinkSpin).',
|
||||
pending: 'Your LinkSpin tracked link is being set up. Until then visitors go straight to your link.', 'no-username': 'Sign in through InstantAdPay or LinkSpin once to link your LinkSpin account.',
|
||||
'no-account': 'No LinkSpin account was found for your network username yet. Visitors go straight to your link.' }[ls.state];
|
||||
'no-account': 'No LinkSpin account was found for your network username yet. Visitors go straight to your link.',
|
||||
spin: 'Your ad link is your own LinkSpin spin link, so its clicks already show in your LinkSpin Reports.' }[ls.state];
|
||||
if (ls.state !== 'tracked') return '<p class="lsline small">' + esc(why || '') + '</p>';
|
||||
const c = ls.clicks;
|
||||
return '<p class="lsline small">Tracked with LinkSpin: <b>' + esc(ls.link.replace(/^https?:\/\//, '').replace(/\?.*$/, '')) + '</b>'
|
||||
+ (c ? ' · ' + VAB.n(c.hits) + ' clicks in all, ' + VAB.n(c.hits30) + ' in 30 days (' + VAB.n(c.unique30) + ' unique)' : ' · clicks show in your LinkSpin Reports')
|
||||
+ ' · <a href="https://linkspin.app/ads" target="_blank" rel="noopener">Open LinkSpin</a></p>';
|
||||
};
|
||||
// "Use one of my spin links" (2026-11-15): the member's own LinkSpin spin links as the ad link. A spin link is already tracked on
|
||||
// LinkSpin, so "Track with LinkSpin" is switched off (and greyed) while the link is one. The server checks the link is the member's own.
|
||||
let spins = null, spinAd = null;
|
||||
const isSpin = v => { v = String(v || '').trim().toLowerCase(); if (spinAd && v === String(spinAd).toLowerCase()) return true; return !!(spins && spins.some(x => x.url.toLowerCase() === v)); };
|
||||
const spinMark = () => { const on = isSpin($('fLink').value); $('fTrack').disabled = on; $('trackNote').hidden = !on; $('fTrack').closest('label').style.opacity = on ? '0.6' : ''; };
|
||||
$('fLink').addEventListener('input', spinMark);
|
||||
$('spinBtn').onclick = async () => {
|
||||
const box = $('spinList');
|
||||
if (!box.hidden) { box.hidden = true; return; }
|
||||
box.hidden = false; box.innerHTML = '<p class="small muted" style="margin:0">Asking LinkSpin for your spin links...</p>';
|
||||
const r = await VAB.getJSON('/api/my/spins').catch(() => ({ error: 'LinkSpin did not answer. Try again in a minute.' }));
|
||||
if (r.error) { box.innerHTML = '<p class="small" style="margin:0">' + esc(r.error) + '</p>'; return; }
|
||||
spins = r.spins || [];
|
||||
if (!r.account) { box.innerHTML = '<p class="small" style="margin:0">No LinkSpin account was found for your network username yet. <a href="https://linkspin.app" target="_blank" rel="noopener">Open LinkSpin</a></p>'; return; }
|
||||
if (!spins.length) { box.innerHTML = '<p class="small" style="margin:0">You have no spin links on LinkSpin yet. Make one there (add every page you promote), then come back and pick it. <a href="https://linkspin.app/links" target="_blank" rel="noopener">Open LinkSpin</a></p>'; return; }
|
||||
box.innerHTML = '<p class="small muted" style="margin:0 0 8px">Pick one. Your ad sends each click to the next page on that spin link.</p>'
|
||||
+ spins.map((x, i) => '<button type="button" class="btn-soft" data-i="' + i + '" style="display:block;width:100%;text-align:left;margin:0 0 6px"' + (x.paused || !x.destinations ? ' disabled' : '') + '><b>' + esc(x.name || x.code) + '</b> <span class="small muted mono">' + esc(x.url.replace(/^https?:\/\//, '')) + '</span> <span class="small">'
|
||||
+ (x.paused ? '(paused on LinkSpin)' : !x.destinations ? '(no active pages yet)' : VAB.n(x.destinations) + (x.destinations === 1 ? ' page' : ' pages')) + '</span></button>').join('');
|
||||
box.querySelectorAll('button[data-i]').forEach(b => { b.onclick = () => { const x = spins[Number(b.dataset.i)]; $('fLink').value = x.url; spinMark(); box.hidden = true; VAB.status('Spin link picked. Save your ad to use it.', 'ok'); }; });
|
||||
};
|
||||
async function load() {
|
||||
const d = await VAB.getJSON('/api/my'); if (d.error) { VAB.status(d.error, 'err'); return; }
|
||||
$('dash').hidden = false;
|
||||
@@ -72,7 +93,8 @@
|
||||
} else {
|
||||
$('adForm').hidden = !!a; $('adNote').hidden = !!a;
|
||||
if ($('editAd')) $('editAd').onclick = () => { const h = !$('adForm').hidden; $('adForm').hidden = h; $('adNote').hidden = h; $('editAd').textContent = h ? 'Edit ad' : 'Close the editor'; if (!h) $('fHead').focus(); };
|
||||
if (a) { $('adHead').textContent = 'My text ad'; $('fHead').value = a.headline; $('fL1').value = a.line1; $('fL2').value = a.line2 || ''; $('fLink').value = a.link; $('fTrack').checked = a.track !== false; $('adSave').textContent = 'Save changes'; }
|
||||
if (a) { $('adHead').textContent = 'My text ad'; $('fHead').value = a.headline; $('fL1').value = a.line1; $('fL2').value = a.line2 || ''; $('fLink').value = a.link; $('fTrack').checked = a.track !== false; $('adSave').textContent = 'Save changes'; spinAd = a.spin ? a.link : null; }
|
||||
spinMark();
|
||||
if (!counted) { counter($('fHead'), $('cHead'), lim.headline); counter($('fL1'), $('cL1'), lim.line); counter($('fL2'), $('cL2'), lim.line); counted = true; }
|
||||
else ['fHead', 'fL1', 'fL2'].forEach(id => $(id).dispatchEvent(new Event('input')));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user