User:Lexein/wordfreq.js

javascript:(function{var%20T={},W=[],C=0,s,i;%20function%20F(n){var%20i,x,a,w,t=n.tagName;if(n.nodeType==3){a=n.data.toLowerCase.split(/[\s\(\)\:\,\.;\<\>\&\'\"]/),i;for(i%20in%20a)if(w=a[i]){w="%20"+w;T[w]=T[w]?T[w]+1:1;++C;}}if(t!="SCRIPT"&&t!="STYLE")for(i=0;x=n.childNodes[i];++i)F(x)}F(document);for(i%20in%20T)W.push([T[i],i]);W.sort(function(a,b){var%20x=b[0]-a[0];return%20x?x:((b[1]<a[1])?1:-1)});%20s=" "+C+"%20words ";for(i%20in%20W)s+=W[i][0]+":"+W[i][1]+" ";with(open.document){write(s);close}}) //======= only copy text from above this line ======= //This is a BOOKMARKLET to generate a word frequency table for the currently displayed page. // //To install it, create a new bookmark in your browser's bookmark bar. Copy/paste the above code into the Address or Location field, and give the bookmark a name like "WordFreq". // //To use it, just go to any web page of interest, click the bookmarklet. The sorted list of words, in descending order of frequency will appear almost instantly, and can be copy/pasted as normal text for use anywhere. // //Source: http://www.searchlores.org/bookmarklets.htm