Nexus Green Scanner

GreenFlow Intelligence

Restflödes- & Bidragsanalys
Typ av investering / Material
Investeringsbudget (SEK)
function runGreenScan() { const keyword = document.getElementById(‘scan-keyword’).value; const amount = document.getElementById(‘scan-amount’).value; const resultDiv = document.getElementById(‘scan-results’); const apiUrl = ‘http://127.0.0.1:5001/scan_green’; resultDiv.innerHTML = ‘
🔄 Kontaktar Nexus Database…
‘; fetch(apiUrl, { method: ‘POST’, headers: { ‘Content-Type’: ‘application/json’ }, body: JSON.stringify({ keyword: keyword, amount: amount }) }) .then(response => response.json()) .then(data => { if(data.count > 0) { let html = `
✅ ${data.count} BIDRAG HITTADES
`; data.matches.forEach(match => { html += `
${match.name}
${match.desc}
💰 Stöd: upp till ${match.support_sek.toLocaleString()} SEK Deadline: ${match.deadline}
`; }); resultDiv.innerHTML = html; } else { resultDiv.innerHTML = ‘
Inga direkta matchningar. Försök med bredare sökord (t.ex. ”plast” eller ”digital”).
‘; } }) .catch(err => { resultDiv.innerHTML = ‘
❌ Fel: Kunde inte nå servern. (Är Python igång?)
‘; console.error(err); }); }