Back to article
Quick Firefox Tip: Word Count Bookmarklet
Firefox Bookmarklet Counts Words, Not Tags
November 5, 2008
Articles written for Linux Planet have to meet a specified word count. Articles must also be HTML-tagged.
That means we authors need a way to count words. It would be easy in emacs ... if you don't mind counting all the HTML tags as words. Otherwise, not so easy. I can view the HTML in a browser, copy, then paste into a terminal where I'm running wc -w. But Firefox sometimes has some issues pasting large chunks of text (I thought it was bug 56219, but that's marked fixed; perhaps it's related to bug 84973) and anyway, it's a hassle to have to use two windows like that.
I've pared it down to make a simple but neat little Count Words bookmarklet. To use it, right-click on the link and Copy Link Location. Then paste it into Firefox when you're pointed at a page where you want to count words. To keep it, make a new bookmark and paste the bookmarklet into the URL field, and you'll be able to call it up on any page. Or give it a Keyword, like countwords, when you're saving the bookmark, then when you're on any page, type