The Adblock Project Forum Index The Adblock Project
Pull up a seat ...stay a while.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How block this banner?

 
Post new topic   Reply to topic    The Adblock Project Forum Index -> Main
View previous topic :: View next topic  
Author Message
Sergei
Guest





PostPosted: Thu Jan 01, 2004    Post subject: How block this banner? Reply with quote

It's here www.e-mail.ru
written with perl
i have /.*banner.*/ in my blockscript
Back to top
Guest






PostPosted: Thu Jan 01, 2004    Post subject: Reply with quote

The simplest way would be to put

/banner.

in your blocklist. A regexp which blocks it would be (from my own list)

/[\W]banner(s|id\=)?[\W\d]/

This also blocks some other types.
Back to top
Sergei
Guest





PostPosted: Thu Jan 01, 2004    Post subject: Reply with quote

ok but what for do you write square brackets around \W ?
you just can write:
/\Wbanner(s|id\=)?[\W\d]/
(here [\W\d] only matches \W or \d and not both)
or simply
/banner/ 'd be fine
yes?
Back to top
Guest






PostPosted: Thu Jan 01, 2004    Post subject: Reply with quote

I originally had something more than \W there, but I removed it. I left the brackets for aesthetic reasons.

And yes, you are right. In this case /banner/ would work just as well, but that filter is a bit to general for my taste, it might block too much.
Back to top
Org



Joined: 23 Oct 2003
Posts: 349

PostPosted: Thu Jan 01, 2004    Post subject: Reply with quote

Anonymous wrote:
In this case /banner/ would work just as well, but that filter is a bit to general for my taste, it might block too much.

This is an understatement. "/banner/" would block way too much. For example sites like: http://bannerblind.mozdev.org/ or pages like: "how_to_block_banners.html", etc, etc.

BTW, that particular banner (.../scripts/banner.pl?cmd=...) is particulary annoying. I would use something like this to block it:

/[.\/]banner[sz]?(\.pl|\.cgi|[.\/])/

This would block e.g.:
-ttp://banner.somesite.com/
/banner/
/banners/
/banner.pl
/banner.cgi
Back to top
View user's profile Send private message
kstahl
Support


Joined: 02 Jan 2004
Posts: 1202
Location: Stockholm, Sweden

PostPosted: Fri Jan 02, 2004    Post subject: Reply with quote

So would the much more simple

/\Wbanners?\W/

At least I think it would.


(I'm no longer "Guest")
Back to top
View user's profile Send private message
Org



Joined: 23 Oct 2003
Posts: 349

PostPosted: Fri Jan 02, 2004    Post subject: Reply with quote

kstahl wrote:
So would the much more simple

/\Wbanners?\W/

Yes, it would block all those, but it would also block something like "/how-to-block-banners.html" (a bit unrealistic example, I know, but still). Regexps are so powerful that I think it's worth the trouble to try to define the blocks to be as precise as possible. False positives are nasty, bacause in some cases you don't necessarily ever notice that you don't see all there is to see.

If you are unsure how certain regexp works, you can use the tip rue gave in some earlier thread. Open the JavaScript Console and enter tests like this:

Code:
alert(/\Wbanners?\W/i.test("/how-to-block-banners.html"));

alert(/[.\/]banner[sz]?(\.pl|\.cgi|[.\/])/i.test("/how-to-block-banners.html"));
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The Adblock Project Forum Index -> Main All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group