Banner ad blocker ? Anyone with a good blocklist or better code

From: Armistead, Jason <>
Date: Thu, 12 Mar 1998 17:36:00 -0500


I've been running a Perl redirector script, which with a careful
analysis of the Squid access.log file has been able to help me filter
out URLs which are nothing more than banner GIF files, and then to
redirect the request to a locally served & stored GIF image (I use
several different URLs, though I should probably eventually stick to
one, easily changed one for all add sites). This is a valuable upstream
bandwidth saver for us, and also has the advantage of keeping these
files out of the cache (disk /memory requirements are smaller and we get
a better hit ratio).

For a small ISP, this could be a good cost saver, and a chance to put
your favourite motd (Message Of The Day) or similar onto some well hit
sites (as long as the viewing public don't then try to go to the
underlying URLs in the HTML (which could also be redirected I guess - I
just never bothered with it).

So, I've had a look on the net for a definitive list of blocked ad
sites. I found, but a search for their
recommended phrases on AltaVista revealed only one site (better than a
kick in the head I guess). The only other sites which helped was one
from who appears to be a banner ad
consultant (I have yet to go through his HTML pages and extract all the
URLs for inclusion into the add breaker)

Sure, the advertisers will keep changing their host names and ad
directories, but with a bit of collective effort, we can keep it
up-to-date. Maybe someone with an external Internet site can post a ad
banner URL regexp list that we can add to using a form (as long as the
advertisers can't remove them !!!) ?

Anyone want to swap/share URLs or redirector scripts on this one ? Here
is my redirector code, in case anyone wants it. It's pretty primitive,
just a whole lot of pattern matching and IFs. Heck, I didn't even quote
the "." characters in the regexps !



------------------8<---- snip ----8<-----------------------------

local# more


 $base = "";
 $no_ads = $base . "no_ads.gif\n";

 $no_adds_dn = $base . "no_adds_dn.gif\n";
 $no_adds_dblclick = $base . "no_adds_dblclick.gif\n";
 $no_av_left = $base . "no_av_left.gif\n";
 $no_av_right = $base . "no_av_right.gif\n";
 $no_lycos_ads = $base . "no_lycos_ads.gif\n";
 $no_focalink_ads = $base . "no_focalink_ads.gif\n";
 $no_infoseek_ads = $base . "no_infoseek_ads.gif\n";
 $no_aol_ads = $base . "no_aol_ads.gif\n";
 $no_aol_mini_ads = $base . "no_aol_mini_ads.gif\n";
 $no_infospace_adman = $base . "no_infospace_adman.gif\n";
 $no_infospace_ads = $no_ads;
 $no_yimg_ads = $no_ads;
 $no_yahoo_ads = $no_ads;
 $no_yahoo_promo = $base . "no_yahoo_promo.gif\n";

 while (<>) {

# Start of ad removal process && do {$_ = $no_adds_dn; };
     m@ && do {

# AltaVista adds
# There is a left and right badge for the AltaVista title line

       if (m@altavista@o) {
          if (m@left@o) {$_ = $no_av_left; }
          elsif (m@right@o) {$_ = $no_av_right; }
          else {$_ = $no_adds_dblclick; }


# Lycos has its own ads server (for the moment anyhow)

     if (m@ {$_ = $no_lycos_ads; }

# Focalink use adds on a number of servers, all with the same
# CGI program

     if ( {$_ = $no_focalink_ads; }

# InfoSeek has its own ad directory too

     if (m@ {$_ = $no_infoseek_ads; }

# AOL Netfind has an ad redirector of sorts

     if (m@ {

        if (m@/image/@o) {
           if (m@\?@o) {$_ = $no_aol_ads; }
           else {$_ = $no_aol_mini_ads; }
        elsif (m@/content/@o) {$_ = $no_aol_ads; }
        else {$_ = $no_aol_ads; }

     if (m@ {$_ = $no_infospace_adman;
     if (m@ {$_ =
$no_infospace_adman; }

# Infospace use two servers called pic1 and pic2, but sometimes their IP

     if ((m@http://199.242.24@o) || (m@http://pic\ {
       if (m@/ads/@o) {$_ = $no_infospace_ads; }

# Yimg ads have the format or /adv

     if (m@ {$_ = $no_yimg_ads; }

# Yahoo ads have or URLs
# or with appropriate country suffix in domain name

       {$_ = $no_yahoo_ads; }

       {$_ = $no_yahoo_promo; }

# End of ad removal process

Received on Thu Mar 12 1998 - 14:48:15 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:39:21 MST