Online Journalism Fact-Checking Tool

Online Journalism Fact-Checking Tool

Paste an article or claim to analyze its factual accuracy.

Article or Claim

No distinct factual claims were identified in the provided text.

'; return; } let tableHtml = ``; data.forEach(item => { tableHtml += ``; }); tableHtml += `
ClaimRatingExplanation & Source
${item.claim} ${item.rating} ${item.explanation}
`; reportContainer.innerHTML = tableHtml; }; // --- PDF Download Functionality --- pdfBtn.addEventListener('click', () => { if (reportData.length === 0) { showMessage('No report data to download.', 'error'); return; } try { const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFont('helvetica', 'bold'); doc.setFontSize(18); doc.text('Journalism Fact-Checking Report', 105, 20, { align: 'center' }); doc.line(15, 25, 195, 25); const tableData = reportData.map(item => [item.claim, item.rating, item.explanation]); doc.autoTable({ startY: 35, head: [['Claim', 'Rating', 'Explanation & Source']], body: tableData, theme: 'grid', headStyles: { fillColor: [79, 70, 229] }, // Indigo color columnStyles: { 0: { cellWidth: 60 }, 1: { cellWidth: 30 }, 2: { cellWidth: 'auto' } } }); doc.save('fact-checking-report.pdf'); showMessage('Report downloaded successfully!', 'success'); } catch (e) { console.error("Error generating PDF:", e); showMessage('Could not generate PDF. Please try again.', 'error'); } }); // --- Custom Message/Alert Box --- const showMessage = (message, type = 'success') => { messageBox.textContent = message; messageBox.className = `message-box ${type}`; messageBox.classList.add('show'); setTimeout(() => { messageBox.classList.remove('show'); }, 3000); }; // Initialize view showTab(0); });
Scroll to Top