Closing Cost Calculator Washington State

SEO Content Analyzer

Word Count
0
Readability
Est. Read Time
0m

Top Keyword Density

Keyword Count Density
function analyzeSEOContent() { var text = document.getElementById('seoInput').value; var resultsDiv = document.getElementById('seoResults'); if (!text.trim()) { alert('Please enter some text to analyze.'); return; } var words = text.toLowerCase().match(/\b(\w+)\b/g); if (!words) return; var wordCount = words.length; document.getElementById('wordCount').innerText = wordCount; var readTime = Math.ceil(wordCount / 225); document.getElementById('readTime').innerText = readTime + 'm'; var avgWordLength = words.join(").length / wordCount; var readability = "Good"; if (avgWordLength > 6) readability = "Complex"; if (avgWordLength < 4.5) readability = "Simple"; document.getElementById('readabilityScore').innerText = readability; var counts = {}; var stopWords = ['the', 'and', 'a', 'to', 'of', 'in', 'is', 'it', 'with', 'that', 'for', 'on', 'was', 'as', 'are', 'at', 'be', 'this', 'have', 'from', 'or', 'by', 'not', 'but', 'if', 'your', 'we', 'can', 'an']; for (var i = 0; i 2 && stopWords.indexOf(word) === -1) { counts[word] = (counts[word] || 0) + 1; } } var sortedWords = []; for (var key in counts) { sortedWords.push([key, counts[key]]); } sortedWords.sort(function(a, b) { return b[1] – a[1]; }); var html = "; var limit = Math.min(sortedWords.length, 8); for (var j = 0; j < limit; j++) { var keyword = sortedWords[j][0]; var count = sortedWords[j][1]; var density = ((count / wordCount) * 100).toFixed(2); html += '' + '' + keyword + '' + '' + count + '' + '' + density + '%' + ''; } document.getElementById('densityBody').innerHTML = html; resultsDiv.style.display = 'block'; }

Leave a Comment