/**
* @author https://codepen.io/bookmarklets
* @file Word Mode 2 - Gives you the "mode" for a page(word);
Displays the top 20 words to appear on the current page in a popup modal window.
* Original Source {@link https://cdpn.io/bookmarklets/fullpage/NobJbq#}
*/
javascript:var page=window.location.href;
var counts={};
var text=document.body.textContent||document.body.innerText||'';
var words=text.split(/\b/).filter(function(word){return word.match(/^\w+$/)!==null});words.forEach(function(word){counts['_'+word.toLowerCase()]=(counts['_'+word]||0)+1});
var sorted=Object.keys(counts).sort(function(a,b){return counts[b]-counts[a]});
var message=sorted[0]===undefined?'No words found!':'