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 

Somebody could check this script for memory & CPU time c

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





PostPosted: Wed Dec 31, 2003    Post subject: Somebody could check this script for memory & CPU time c Reply with quote

Somebody could check this script for memory & CPU time consumption?


[Adblock]
/(?:\d+|[&\.\-_=\?\/]+)[Aa]d(?:s|v|x)?(?:\d+|[&\.\-_=\?\/]+)?/
/(?:\d+|[&\.\-_=\?\/]+)[Bb]ans?(?:\d+|[&\.\-_=\?\/]+)/
/(?:\d+|[&\.\-_=\?\/]+|ad|double|fast|go|smart|value)click/
/(?:about|exchange|net|serve|show|swift|utopi)ad/
/(?:hot|ip|spy|web)log/
/[Bb]anner/
/ad(?:bot|buy|[Cc]enter|clix|client|club|content|control|council|cycle|farm|\-flow|force|fr/annonce/
/barter/
/bnr/
/clicks?(?:\d+|[&\.\-_=\?\/]+|ability|agent|cgi|id|over|serve|thru|through)/
/c(?:ou)?nt/
/hitbox/
/linkexchange/
/log(?:er|ging)/
/pop(?:under|up)/
/promo/
/publicite/
/redir/
/referrer/
/reklama/
/rotat(?:e|ion)/
/servlet/
/sponsor/
/stat/
/track(?:er|ing)/
/ju?mp/
/\d{2,}x\d{2,}/
Back to top
Sergei
Guest





PostPosted: Wed Dec 31, 2003    Post subject: Small upgrade :) Reply with quote

I think this'd be better

[Adblock]
/.*(?:\d+|[&\.\-_=\?\/]+)[Aa]d(?:s|v|x)?(?:\d+|[&\.\-_=\?\/]+)?.*/
/.*(?:\d+|[&\.\-_=\?\/]+)[Bb]ans?(?:\d+|[&\.\-_=\?\/]+).*/
/.*(?:\d+|[&\.\-_=\?\/]+|ad|double|fast|go|smart|value)click.*/
/.*(?:about|exchange|net|serve|show|swift|utopi)ad.*/
/.*(?:hot|ip|spy|web)log.*/
/.*[Bb]anner.*/
/.*\d{2,}x\d{2,}.*/
/.*ad(?:bot|buy|[Cc]enter|clix|client|club|content|control|council|cycle|farm|\-flow|force|/.*annonce.*/
/.*barter.*/
/.*bnr.*/
/.*c(?:ou)?nt.*/
/.*clicks?(?:\d+|[&\.\-_=\?\/]+|ability|agent|cgi|id|over|serve|thru|through).*/
/.*hitbox.*/
/.*ju?mp.*/
/.*linkexchange.*/
/.*log(?:er|ging).*/
/.*pop(?:under|up).*/
/.*promo.*/
/.*redir.*/
/.*referrer.*/
/.*reklama.*/
/.*rotat(?:e|ion).*/
/.*servlet.*/
/.*sponsor.*/
/.*stat.*/
/.*track(?:er|ing).*/
Back to top
rue
Developer


Joined: 22 Oct 2003
Posts: 752

PostPosted: Wed Dec 31, 2003    Post subject: Reply with quote

Sergei:
Your upgrade introduced serious overhead. JavaScript doesn't require beginning or trailing wildcards for matching within a string.
.
Secondly, these look too generic for usefulness (false-positives):
/ju?mp/
/log(?:er|ging)/
/rotat(?:e|ion)/

.
Additionally, there's a typo here:
/ad(?:bot|buy|[Cc]enter|clix|client|club|content|control|council|cycle|farm|\-flow|force|fr / annonce/
The forward-slash should be a closing-parenthesis: ")"
Back to top
View user's profile Send private message
Sergei
Guest





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

Ok i'll redo it
as i guess you are competent enough
Back to top
Sergei
Guest





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

BTW i see what is wrong with this line:
/ad(?:bot|buy|[Cc]enter|clix|client|club|content|control|council|cycle|farm|\-flow|force|fr/annonce/
i cut & pasted this line:
_________________________

/.*ad(?:bot|buy|[Cc]enter|clix|client|club|content|control|council|cycle|farm|\-flow|force|frame
graph|gif|[Ii]d|img|image|juggle|knowledge|ladder|lib|link|log|man|master|monitor|net|optimizer|
pics|push|redir|runner|sales|serv|space|src|stream|swap|traq|type|vert|[Vv]iew).*/
/.*annonce.*/
_______________________
But it's got shortened & next line to it got moved to previous
Also rue i'd like to ask you
first:
do i have to write such a string:
/[\W]banner(?:s|z)?/
or just
/banner/
as i understand if second line matches banner then it also matches banners & bannerz etc
that includes word 'banner' and it's 90% possibility of a real banner we deal with
right?
May i write /advert/ instead of /advertising\./ for examle?
second:
adblock looks only at location of an element
or at the pointing adress
i mean
<img src=
or
<a href=

P.S. Listen to Symphony X and you'll be as healthy as never before!
Back to top
rue
Developer


Joined: 22 Oct 2003
Posts: 752

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

Sergei wrote:
Ok i'll redo it
as i guess you are competent enough

"Indeed."
.
Yes, /advert/ would match everything /advertising\./ would -- and then some.
.
By default, Adblock only checks an element's src. If you enable the option to "check parent links", then each image / object's hierarchy is traversed to see if there's any containing link -- if so, the link's url is filtered first.
.
Links which only contain text aren't filtered.

.
ps: symphony x?
Back to top
View user's profile Send private message
Sergei
Guest





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

Also i've forgotten
how to enable the option to "check parent links"?
Back to top
kstahl
Support


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

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

Tools > Adblock > Preferences > Adblock Options > Check Parent Links
Back to top
View user's profile Send private message
Sergei
Guest





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

[Adblock]
/(?:[^A-Za-z]+|ad|double|fast|go|smart|value)click/
/(?:about|exchange|net|serve|show|swift|utopi)ad/
/(?:hot|ip|spy|web)log/
/[^A-Za-z]+[Aa]d(?:s|v|x)?[^A-Za-z]+/
/[^A-Za-z]+[Bb]anners?[^A-Za-z]+/
/[^A-Za-z]+[Bb]ans?[^A-Za-z]+/
/[^A-Za-z]+bnr[^A-Za-z]+/
/[^A-Za-z]+c(?:ou)?nt[^A-Za-z]+/
/[^A-Za-z]+promos?[^A-Za-z]+/
/[^A-Za-z]+redir[^A-Za-z]+/
/[^A-Za-z]+referrer[^A-Za-z]+/
/[^A-Za-z]+reklama[^A-Za-z]+/
/[^A-Za-z]+servlets?[^A-Za-z]+/
/[^A-Za-z]+sponsors?[^A-Za-z]+/
/[^A-Za-z]+stats?[^A-Za-z]+/
/[^A-Za-z]+tracks?(?:er|ing)s?[^A-Za-z]+/
/\d{2,}x\d{2,}/
/ad(?:bot|buy|[Cc]enter|click|client|content|control|\
cycle|farm|\-flow|force|frame|graph|gif|img|image|juggle|\
knowledge|ladder|link|log|man|master|monitor|net|\
optimizer|pics|runner|serv|space|stream|vert|[Vv]iew)/
/clicks?(?:[^A-Za-z]+|ability|agent|cgi|id|over|serve|thru|through)/
/hitbox/
/linkexchange/
Back to top
Guest






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

Sergei,

I'm not sure the point of all your "+" characters after the [^A-Za-z]. They serve no real purpose as you are really trying to match one occurrence of [^A-Za-z] before your test string and one occurrence after. Matching more than one occurrence achieves nothing more. It may even slow down the filtering. I would suggest either \W or [\W_] at the beginning of filters as I think numerics there are rare, and [\W\d] or [\W\d_] at the end.

Adblock is case-insensitive so "[Cc]" is the same as "c".

/\d{2,}x\d{2,}/ could match a lot of false positives depending on the sites you view.
Back to top
Sergei
Guest





PostPosted: Sat Jan 03, 2004    Post subject: Reply with quote

+ means 1 or more occurances e.g. % or %% or .... or 77 or $$$ etc
well i didn't study all possible advertisement strings in URLs that you can meet in the WEB but i suppose that this form would work for more different
ad possibilities
ok maybe i'll redo it a little bit 8^)

Adblock is case-insensitive? i didn't know that... are you sure 'bout that?

what about /\d{2,}x\d{2,}/ well that the opinion of each to use it or not
i'll see if it would work well or not

Guys who have Gentoo Linux? Could you write me CD-R with it
i have Slackware 9 if someone wants to try it.
Back to top
Org



Joined: 23 Oct 2003
Posts: 349

PostPosted: Sat Jan 03, 2004    Post subject: Reply with quote

Sergei wrote:
but i suppose that this form would work for more different
ad possibilities

Read again what Guest wrote: "Matching more than one occurrence achieves nothing more." That's true, because those matches happen at the both ends of the pattern.
Back to top
View user's profile Send private message
Guest






PostPosted: Sat Jan 03, 2004    Post subject: Reply with quote

My point about the "+" is that as far as Adblock is concerned, a filter /[^A-Za-z]ads[^A-Za-z]/ would match everything that /[^A-Za-z]+ads[^A-Za-z]+/ matches. They both match http://ads.com. It is just that the simple filter only matches the "/ads." part while the complex filter matches the "://ads." part. Either way, Adblock finds a match and filters ther URL. Then, if that is the case, why bother with the "+"?

Look at this topic among others which mention case sensitivity.
Back to top
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