Comment

An Interesting LA Times Piece on the Legacy of NSA Leader Gen. Keith Alexander

197
Charles Johnson3/31/2014 2:21:57 pm PDT

Here, have a bookmarklet that counts characters and words in selected text on a web page:

javascript:(function(){var a=(document.selection?document.selection.createRange().text:document.getSelection()).toString();alert(a.length?"Characters: "+a.length+"\nWords: "+a.replace(/\s{2,}/g," ").split(" ").length:"No text selected.")})();

I bashed this out today because I wanted to easily be able to see how many words were in a given article; I used to copy and paste the article into a new BBEdit window and see the count there, but this is much simpler - just select the text and click the bookmarklet.

You can just drag this code to your browser’s bookmarks bar.