I generally post to twitter mostly via Gmail using TwitterMail. It's great for fast posts without having to visit the Twitter website. You just put the post in the subject line. However, I soon found I needed to find the word count of the subject in order to stay under Twitter's 140 character limit.
A script was born...
I've written a GreaseMonkey script to get the job done. On the Gmail Compose screen, it displays the word count in brackets next to the subject header. It's compatible with Firefox and Google Chrome.
The script can be found here.