(function() { var codeBlocks = document.getElementsByTagName('pre'), codeLines = 0, body = document.getElementsByTagName('body')[0], text = function(el) { if (el.innerText) return el.innerText; return el.textContent; }; var wordCount = text(body).split(' ').length; for (var i = codeBlocks.length - 1; i >= 0; i--) { var code = text(codeBlocks[i]); if (code) { codeLines += code.split('\n').length; wordCount -= code.split(' ').length;; } } var total = wordCount + codeLines * 10; var list = []; list.push(wordCount + ' words (not including code)'); list.push(codeLines + ' lines of code (counting for ' + codeLines * 10 + ' words)'); list.push(total + ' total'); var message = 'Article has:'; message += '