Online Fact-Checking & Research Accuracy Tool

Fact-Checking & Research Accuracy Tool

Verify your claims against your source material.

An error occurred. The AI may have failed to generate a valid report. Please try again with clearer text.

`; } finally { loader.classList.add('hidden'); loader.classList.remove('flex'); reportWrapper.classList.remove('hidden'); } }); const getStatusColor = (status) => { switch(status) { case 'Verified': return 'bg-green-100 text-green-800'; case 'Contradicted': return 'bg-red-100 text-red-800'; default: return 'bg-yellow-100 text-yellow-800'; } }; const renderReport = (data) => { reportBody.innerHTML = ''; if (!data || data.length === 0) { reportBody.innerHTML = 'No specific claims could be verified from the provided text.'; return; } data.forEach(item => { const row = document.createElement('tr'); row.innerHTML = ` ${item.claim || 'N/A'} ${item.status || 'N/A'} "${item.evidence || 'N/A'}" `; reportBody.appendChild(row); }); }; // --- PDF Export --- pdfBtn.addEventListener('click', () => { if (reportData.length === 0) { showMessage('No report to download.', 'error'); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF({ orientation: 'landscape' }); doc.setFontSize(18); doc.text('Fact-Checking & Accuracy Report', doc.internal.pageSize.getWidth() / 2, 20, { align: 'center' }); const tableData = reportData.map(item => [item.claim, item.status, item.evidence]); doc.autoTable({ startY: 30, head: [['Claim', 'Status', 'Evidence from Source']], body: tableData, headStyles: { fillColor: [79, 70, 229] }, columnStyles: { 0: { cellWidth: 80 }, 1: { cellWidth: 30 }, 2: { cellWidth: 'auto' } } }); doc.save('fact-checking-report.pdf'); }); // --- Utility --- const showMessage = (message, type = 'success') => { messageBox.textContent = message; messageBox.className = `message-box ${type} show`; setTimeout(() => { messageBox.classList.remove('show'); }, 3000); }; });
Scroll to Top