Old Proxomitron Forums
Proxomitron Filters - Discussions welcome => Spam Blockers => Topic started by: strapatz2 on April 05, 2002, 12:56:14 PM
-
Hi,
some webpages contain ads that have an invalid ALT-field, e.g., http://searchenginewatch.com/webmasters/frames.html. After filtering using the Banner Blaster (limit text), only [] is left over. By modifying this filter as follows, at least the text [Ad] is displayed.
Maybe this idea is useful for the next version?
Bye,
Lennert.
Name = "Banner Blaster (limit text)"
Active = TRUE
Multi = TRUE
Bounds = "<(as[^>]++href=*</a>|input*>|layer*>)"
Limit = 900
Match = "(<layer*|1<i(mg|mage|nput)*src=$AV(*)*>3)"
"&(*(href|src)=$AV($LST(AdKeys)*)|"
"*http://*<i(mg|mage|nput)s(*>&&"
"(*width=[#460-480]&*height=[#55-60]*)|"
"(*width=[#88]&*height=[#31]*)))"
"&(*alt=$AV((?+{18})2*|(?+{2})2*)|$SET(2=Ad))"
Replace = "<center>1<font size=1 color=red>[2]</font>3</center>"
-
hi strapatz,
it is a good idea.
the filter i have and the same filter in zxlist already have this feature but this doesn't mean anything, you have done a good work.
you can simplify the last line of the matching expression in this way:
"&(*alt=$AV((?+{18})2*|2)|$SET(2=Ad))"
that means:
if the lenght of the alt attribute is greater than 18 chars set 2 to the first 18 chars; otherwise set 2 to the content of the alt attribute; if the alt attribute is missing set 2 to ad.
this matching expression:
"&(*alt=$AV((?+{18})2*|(?+{2})2*)|$SET(2=Ad))"
instead means:
if the lenght of the alt attribute is greater than 18 chars set 2 to the first 18 chars; otherwise set 2 to the first 2 chars; if the alt attribute is missing set 2 to ad.
there is no reason to set 2 to the first 2 chars: in this case will be more simple set directly 2 to ad, you agree?
i hope this little improvement was useful, and this little discussion help newbies to understand better the filter.
regards,
altosax.
-
hi again strapatz,
my previous message let me think about another little improvement to this filter (and similar "banner blaster full text" and "banner replacer").
i've modified again the last matching line to match also the case alt="" because it is very frequent due to the use of html editors.
here is my new matching line:
"&((*alt="")$SET(2=Ad)|*alt=$AV((?+{18})2*|2)|$SET(2=Ad))"
and here the html code i used for tests:
<a href="http://ad.doubleclick/test.html"><img src="test.jpg" width="470" height="60" alt="you can place a long text here, a short one, no text or no alt attribute at all"></a>
i post also the complete version of the filter, just in case:
Name = "Banner Blaster (limit text)"
Active = TRUE
Multi = TRUE
Bounds = "<(as[^>]++href=*</a>|input*>|layer*>)"
Limit = 900
Match = "(<layer*|1<i(mg|mage|nput)*src=$AV(*)*>3)"
"&(*(href|src)=$AV($LST(AdKeys)*)|"
"*http://*<i(mg|mage|nput)s(*>&&"
"(*width=[#460-480]&*height=[#55-60]*)|"
"(*width=[#88]&*height=[#31]*)))"
"&((*alt="")$SET(2=Ad)|*alt=$AV((?+{18})2*|2)|$SET(2=Ad))"
Replace = "<center>1<font size=1 color=red>[2]</font>3</center>"
regards to all,
altosax.
-
Hi altosax,
You are right that my suggestion was too specific in it's way it handles the two-char case. This is mostly because I am a newbie to Proxomitron matching rules.
Your second suggestion handles exactly the problem I was referring to, e.g., the faulty ALT=""Here comes some text""-case. Still I do not completely understand the entire Banner Blaster filter, but I really do appreciate the power of it!
Best regards,
Lennert.