Cost of Concrete per Square Foot Calculator

SEO Content & Meta Analyzer

Characters: 0 / 60 (Recommended)
Characters: 0 / 160 (Recommended)
General Stats
Words: 0
Readability: N/A
Keyword Density
Type content to see top keywords…
function analyzeSEO() { var title = document.getElementById('seo-title-input').value; var desc = document.getElementById('seo-desc-input').value; var body = document.getElementById('seo-body-input').value; // Character Counts var titleLen = title.length; var descLen = desc.length; var titleEl = document.getElementById('title-count'); titleEl.innerText = 'Characters: ' + titleLen + ' / 60'; titleEl.style.color = (titleLen > 60 || titleLen 160 || descLen 0; }).length; var avgSentence = sentences > 0 ? (words / sentences) : 0; var readability = "Good"; if (avgSentence > 25) readability = "Complex"; if (avgSentence > 35) readability = "Very Hard"; if (words === 0) readability = "N/A"; document.getElementById('stat-readability').innerText = readability; // Keyword Density (Top 3) if (words > 10) { var cleanBody = body.toLowerCase().replace(/[^\w\s]/g, "); var bodyWords = cleanBody.split(/\s+/); var stopWords = ['the', 'a', 'an', 'and', 'or', 'but', 'is', 'are', 'was', 'were', 'in', 'on', 'at', 'to', 'for', 'with', 'that', 'it', 'of']; var freqMap = {}; for (var i = 0; i 3 && stopWords.indexOf(w) === -1) { freqMap[w] = (freqMap[w] || 0) + 1; } } var sorted = Object.keys(freqMap).sort(function(a, b) { return freqMap[b] – freqMap[a]; }); var densityHtml = "; for (var j = 0; j < Math.min(3, sorted.length); j++) { var kw = sorted[j]; var percent = ((freqMap[kw] / words) * 100).toFixed(1); densityHtml += '
' + kw + ': ' + percent + '%
'; } document.getElementById('keyword-list').innerHTML = densityHtml; } else { document.getElementById('keyword-list').innerHTML = 'Need more content…'; } } function clearSEOFields() { document.getElementById('seo-title-input').value = "; document.getElementById('seo-desc-input').value = "; document.getElementById('seo-body-input').value = "; analyzeSEO(); }

Leave a Comment