Kurt McKee

lessons learned in production

Archive

Hey there! This article was written in 2004.

It might not have aged well for any number of reasons, so keep that in mind when reading (or clicking outgoing links!).

Adblocking about.com

Posted 14 November 2004

I was searching for some info on a tool I occasionally use, and one of the Google links took me to about.com. I was really surprised by the amount of junk on the page -- normally I don't pay a lot of attention to about.com since I've got the loud ads handled, but as I scrolled down the page there was this tiny bar that appeared and scrolled down the page with me. Unacceptable.

Luckily, everything ugly on the page (besides their layout) resides in numbered directories on z.about.com, using this format: z.about.com/3/... So the solution is to block everything in numbered directories on z.about.com. Here's my new Adblock filter that handles this case:

/^http:[/][/]z[.]about[.]com[/]\d[/]/

It begins and ends with a slash so that Adblock knows to interpret the entire thing as an expression. Without them the filter would be a primitive "http://z.about.com/*", which might block more than I want. Expressions allow me to be more specific. The ^ indicates that I want the URL to begin with the following text. I have [] around slashes and periods because otherwise they would be interpretted as things other than slashes and periods. The \d indicates that any digit from 0-9 will fit.

Taken all together, if Adblock sees a URL that starts with http://z.about.com/ and the first directory is a single number, it will block whatever was going to be loaded.

☕ Like my work? I accept tips!