Calculation for Food Cost

Keyword Density & Readability Checker

Word Count 0
Reading Time 0 min

Top Keywords (Density)

    { "@context": "https://schema.org", "@type": "SoftwareApplication", "name": "Quick SEO Content Analyzer", "applicationCategory": "SEO Tool", "operatingSystem": "Web", "offers": { "@type": "Offer", "price": "0" } } function analyzeContent() { var text = document.getElementById('seo-content-input').value; var resultsBox = document.getElementById('seo-results'); var wordCountDisplay = document.getElementById('word-count-val'); var readTimeDisplay = document.getElementById('read-time-val'); var keywordList = document.getElementById('keyword-list'); if (text.trim().length === 0) { alert('Please enter some text to analyze.'); return; } var words = text.toLowerCase().match(/\b(\w+)\b/g); var wordCount = words ? words.length : 0; // Reading time calculation (Avg 225 words per minute) var readTime = Math.ceil(wordCount / 225); // Keyword Frequency var freqMap = {}; var stopWords = ['the', 'and', 'a', 'to', 'of', 'in', 'is', 'it', 'with', 'for', 'on', 'was', 'as', 'at', 'by', 'an', 'be', 'this', 'that', 'or']; for (var i = 0; i 3 && stopWords.indexOf(word) === -1) { freqMap[word] = (freqMap[word] || 0) + 1; } } var sortedKeywords = []; for (var key in freqMap) { sortedKeywords.push([key, freqMap[key]]); } sortedKeywords.sort(function(a, b) { return b[1] – a[1]; }); // Update UI wordCountDisplay.innerText = wordCount; readTimeDisplay.innerText = readTime + ' min'; keywordList.innerHTML = "; var limit = Math.min(sortedKeywords.length, 5); for (var j = 0; j < limit; j++) { var density = ((sortedKeywords[j][1] / wordCount) * 100).toFixed(1); var li = document.createElement('li'); li.style.cssText = 'display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #edf2f7;'; li.innerHTML = '' + sortedKeywords[j][0] + '' + '' + sortedKeywords[j][1] + ' times (' + density + '%)'; keywordList.appendChild(li); } resultsBox.style.display = 'block'; } function clearContent() { document.getElementById('seo-content-input').value = "; document.getElementById('seo-results').style.display = 'none'; }

    Leave a Comment