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?

Google, by the numbers

March 19, 2008

After accidentally searching for 50 on Google and getting a link to 50 Cent, I remembered the Google Suggest single-letter test when it launched, which showed the top result Google Suggest would give when you pressed just one letter. I imagine this has changed over time, but I’m doing a different test – what are the first things to come up when you search for numbers, 1-50, and what does that tell us?In each case, I’ve included links to a few of the top links (removing similar links,  which Google sometimes gets right and sometimes doesn’t), and when the source isn’t obvious from the title (like VH-1 going to and is interesting, I’ve added source information.  Also note that Google inserts a bunch of viral videos with numbers in them from YouTube etc. as part of universal search – I’ve just skipped them.

Google, by the Numbers

1 January 1 (Wikipedia [Wp for short]), MPEG-1 (Wp), CSS Level 1 (, VH-1, Deep Space 1 (a NASA project)
2 XML Schema Part 2 & CSS Level 2 (W3), MPEG-2 (Wp), May 2 (Wp) , a Ruby on Rails Tutorial (Part 2)
3 3 (Wp), January 3 (Wp), 3Com, CSS Level 3 Draft (W3), Halo 3, NYC Subway Line 3
4 4 (Wp), MPEG-4 (Wp), NBC4 in Washington DC, NYC Subway 4, 4-H, Human Chromosome 4 (note: when I did this search earlier from my iPhone, I saw 4Chan)
5 5 (Wp), February 5 (Wp), NYC Subway 5, Babylon 5, US Internal Revenue Code 5, NBC5 Chicago, Perl5
6 May 6 (Wp), February 6 (Wp), Google Holiday Doodle (the 6 is in the URL), Motel 6, Big6 (a literacy initiative), Java SE 6, Perl 6 (three links)
7 7 (Wp), January 7 (Wp), 7-Zip, WHDH 7 Boston, ABC 7 SoCal, KIRO 7 Seattle, QuickTime 7
8 8 (Wp), January 8 (Wp), Human Chromosome 8, Channel 8 (MSDN), Super 8, 8 ½ (IMDB), 8 Mile (IMDB)
9 The 9 (Yahoo!), January 9 (Wp), Channel 9 (MSDN), May 9 (Wp), Human Chromosome 9, Form I-9
10 Channel 10 (MSDN), Powers of 10 (the website), NBC 10 Philadelphia, March 10 (Wp), ICD-10 (disease classification, Wp)
20 20 (Wp), September 20 (Wp), 20/20 on ABC, Human Chromosome 20, Top 20 2007 Security Risks, 20Q (2004 Toy of the Year), US Title 20, 20 Years of Perl
30 30 (Wp), 30 Rock, September 30, (then results for 300),  a php statistics app – no idea why it shows up here, WVIT 30 Hartford
40 40 (number) (Wp), 40 Principales (Spanish Top 40), 40 (year) (Wp), The 40 Year Old Virgin (IMDB), American Top 40, WD-40, 40 Ajax accessibility tutorials,
50 50 Cent (official site), 50 Cent (Wp), 50 (number) (Wp), 50 Cent (AOL Music), Lycos top 50, Z39.50 protocol standards

Some notes:

  • Wikipedia, unsurprisingly, dominates the results – numbers, dates, years. The summaries varied widely – sometimes the first sentence of the article, sometimes a random sentence below
  • Technology, especially web standards and Perl, are all over the place. Maybe this is a sign of the long tail of technology online – if there’s nothing else more relevant, technology rushes to fill the space.
  • For every commercial brand (WD-40), there’s a non-brand (Z39.50).

Only because I did well on the last page of the survey

March 13, 2008

I think this is still too high

Clearly I’m ready to get my Texas teacher certification, assuming I meet the Texas teaching requirements.

Links 2008-03-12

March 12, 2008