Connecting to ESPN data feeds...
Scraped • No API Keys • Tue 14 Jul 2026
Match Predictions
Premier League
🎯
No predictions available
Scrape data for Premier League first.
${title}
⚽ SportsCamp — ${title}
Generated: ${new Date().toLocaleString()} • sportsCamp Prediction System • Poisson Model + Groq AI
${tbl.outerHTML} `); w.document.close(); setTimeout(() => { w.focus(); w.print(); }, 400); } function copyCode(el) { const text = el.textContent.replace('click to copy','').trim(); navigator.clipboard.writeText(text).then(() => { const old = el.style.borderColor; el.style.borderColor = '#22c55e'; const sp = el.querySelector('span'); if (sp) { sp.textContent = 'Copied!'; sp.style.color = '#22c55e'; } setTimeout(() => { el.style.borderColor = old; if (sp) { sp.textContent = 'click to copy'; sp.style.color = ''; } }, 2000); }); } // Mobile: scroll main into view if (window.innerWidth < 860) { const m = document.querySelector('main'); if (m) setTimeout(() => m.scrollIntoView({behavior:'smooth',block:'start'}), 120); } // ===== Live Score Updater ===== async function updateLiveScores() { const btn = document.getElementById('liveUpdateBtn'); if (!btn) return; if (btn.dataset.running === '1') return; btn.dataset.running = '1'; btn.innerHTML = '⌛ Updating…'; btn.disabled = true; // Collect all betslip live badges const badges = document.querySelectorAll('.ls-badge'); const picks = []; badges.forEach(b => { picks.push({ fixture: (b.dataset.home || '') + ' vs ' + (b.dataset.away || ''), home_team: b.dataset.home || '', away_team: b.dataset.away || '', date: b.dataset.date || '', market: b.dataset.market || '', selection: b.dataset.selection || '', league: b.dataset.league || '', }); }); if (picks.length === 0) { btn.innerHTML = '📺 No picks to update'; btn.dataset.running = '0'; btn.disabled = false; return; } try { const resp = await fetch('live_update.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ picks }), }); const data = await resp.json(); if (data.results) { // Map results back to badges by matching fixture+market data.results.forEach(r => { badges.forEach(b => { if (b.dataset.home + " vs " + b.dataset.away === r.fixture && b.dataset.market === r.market) { const status = r.status || "PENDING"; let shortStatus = status.length > 20 ? status.substring(0, 17) + "…" : status; b.textContent = shortStatus; // Determine colors per state var accent, tint, textCol; if (status.includes("WON")) { accent = "#16a34a"; tint = "rgba(22,163,74,.22)"; textCol = "#4ade80"; } else if (status.includes("LOST")) { accent = "#dc2626"; tint = "rgba(220,38,38,.22)"; textCol = "#f87171"; } else if (status.includes("LIVE")) { accent = "#d97706"; tint = "rgba(217,119,6,.16)"; textCol = "#fbbf24"; } else { accent = ""; tint = ""; textCol = "var(--muted)"; } if (accent) { b.style.background = tint; b.style.color = textCol; b.style.border = "1px solid " + accent + "66"; b.style.borderRadius = "6px"; b.style.padding = "3px 6px"; } else { b.style.background = "var(--surf2)"; b.style.color = "var(--muted)"; b.style.border = "none"; b.style.padding = "2px 5px"; } // Build score string var scoreStr = ""; if (r.home_score !== null && r.away_score !== null) { if (b.dataset.market === "Corners" && r.home_corners !== undefined) { scoreStr = r.home_corners + " - " + r.away_corners + " corners"; } else if (b.dataset.market === "Corners") { scoreStr = r.home_score + " - " + r.away_score; } else { scoreStr = r.home_score + " - " + r.away_score; } } // Paint full row with left accent var rowId = b.dataset.row; if (rowId) { var trElem = document.querySelector("tr[data-ls-row='" + rowId + "']"); if (trElem) { // Reset trElem.querySelectorAll(".ls-td, td").forEach(function(td) { td.style.removeProperty("background"); td.style.removeProperty("border-left"); }); if (accent) { var cells = trElem.querySelectorAll("td"); cells.forEach(function(td, idx) { if (idx === 0) { td.style.setProperty("border-left", "5px solid " + accent, "important"); td.style.setProperty("background", tint, "important"); } else { td.style.setProperty("background", tint.replace("0.22","0.08"), "important"); } }); } // Display score if (scoreStr) { var scoreEl = trElem.querySelector(".ls-score"); if (scoreEl) { scoreEl.textContent = scoreStr; scoreEl.style.color = textCol; scoreEl.style.fontWeight = "800"; scoreEl.style.fontSize = ".72rem"; } else { // Fallback: show in a data attribute b.textContent = shortStatus + " [" + scoreStr + "]"; } } } } } }); }); } } catch (e) { console.error('Live update failed:', e); btn.innerHTML = '📺 Update Failed'; setTimeout(() => { btn.innerHTML = '📺 Update Scores'; }, 3000); } btn.innerHTML = '📺 Update Scores'; btn.dataset.running = '0'; btn.disabled = false; } // Auto-update on page load (if any badges exist) document.addEventListener('DOMContentLoaded', () => { if (document.querySelectorAll('.ls-badge').length > 0) { setTimeout(updateLiveScores, 2000); } });