Archive for April, 2008

Stop Twitter Spammers with this Greasemonkey script

April 28, 2008

In February I wrote about people who follow you on Twitter for no good reason. Since then I’ve probably received a few dozen more requests from entirely random people/bots/MakeMoneyFasts, and while it doesn’t really mean anything, I find it irksome. Others do too – searching tweetscan for block always produces lots of annoyed people.

Blocking someone, though, is a huge pain. You get the mail message which links to the person, then you have to go to Twitter, go to your follower list, page through it to find that person, and then block. Satisfying, but tiresome.

So today I whipped up a Greasemonkey script to help. (You can stop reading and just download it now if you want.) If you’re a Gmail or Google Apps Mail user, and you receive a mail announcing yet another spammer, you can block them in just two clicks: the first goes to a block page, then you confirm. (There’s no way I’ve found to do it in one click yet.)

Here’s what your mail will look like – note the Block!:

Gmail image with Twitter Block link

Easy to do and satisfying.

You can find the script at this link at Let me know if you have any problems with it.

Some random development notes:

  • This took me about 2.5 hrs, 80% of which was spent learning Greasemonkey, the Gmail Greasemonkey API, and how to do regex replacements in Javascript. I expect doing this for just the Twitter page would take ~30min (so you click through, see that you really don’t know this person, and then block); other mail clients would be fast too, so let me know if you want one.
  • The Gmail Greasemonkey API is a nice touch, esp. because I don’t think you can find the body of a message with XPath otherwise (maybe XPath craps out at a certain # of levels, and the body of the message is 20+ levels deep). However, once you use the API, all document.* functions (including XPath ones) seem to be unavailable: maybe unsafeWindow blocks them, or maybe I just had bad luck.
  • The Dive Into Greasemonkey tutorial might be out of date, but it was still insanely valuable (even if it’s obsessed with timers for some reason).



Adventures in Microsoft PR

April 4, 2008

or, even when he’s (almost) gone, he’s not gone…

From Yahoo News, April 4, 2008:

Microsoft Corp. co-founder Bill Gates said on Friday he expected the new version of Windows operating software, code-named Windows 7, to be released “sometime in the next year or so.”…

A company spokeswoman said Gates’ comments are in line with a development cycle that usually releases a test version of the software before its official introduction.

Give her credit for a nice try, but I do not think that word means what you think it means. Perhaps “or so” would have been a better target?