Post Reply 
Proper order for URL Match parameters
Jan. 17, 2013, 08:21 PM
Post: #1
Proper order for URL Match parameters
I'm getting some strange behavior from the filter below. The idea is that it should only filter s1.zetaboards.com, but it's affecting others - and it depends on the order of the elements in the URL Match box (the only difference between the two below).


Name = "zeta header logo 9-29-12"
Active = TRUE
URL = "s1.zetaboards.com/ $TYPE(htm)|$TYPE(css)"
Limit = 190
Match = "logo* clear:both"

Name = "zeta header logo 9-29-12"
Active = TRUE
URL = "$TYPE(htm)|$TYPE(css) s1.zetaboards.com/"
Limit = 190
Match = "logo* clear:both"


The first filter above affects http://maps.google.com/ (screws up street view)
The second filter affects http://sportsillustrated.cnn.com/college-football/ (alters page layout)

But Google Maps works fine with the 2nd one, and CNNSI works fine with the first one. Without the $TYPE restrictions, it doesn't affect either site. It seems impossible, even if I'm getting the order wrong in the URL Match. Maybe a glitch apart from Proxomitron.

Either way, I'd like to know the proper order for elements in the box. For years I've been using the 2nd method and have just assumed it works, but maybe not. Isn't it ideal to have a $TYPE restriction so that the filter's scope is narrowed as much as possible?
Add Thank You Quote this message in a reply
Jan. 18, 2013, 03:12 AM
Post: #2
RE: Proper order for URL Match parameters
What if you use ($TYPE(htm)|$TYPE(css))?
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to whenever for this post:
zoltan
Jan. 19, 2013, 12:37 AM
Post: #3
RE: Proper order for URL Match parameters
Thanks. I tried it with the $TYPE restriction before and after the URL and it seems to work both ways as long as it's enclosed in ().

So am I to conclude that order doesn't matter?
I wonder about the URL rules also because I'm running into similar issues with another filter.

Code:
Name = "font family new 1"
Active = TRUE
Multi = TRUE
URL = "($TYPE(htm)|$TYPE(css)|$TYPE(js))"
Limit = 99
Match = "font\2family: (arial|"arial"|"Georgia"|georgia|"helvetica neue"|"helvetica"|helvetica|"league gothic"|league gothic|"times new roman"|"
        "times new roman|times|"times"|sans-serif|"sans-serif"|serif|"serif"|lucida grande|"lucida grande"|lucida sans|"lucida sans"|open sans|"
        ""open sans"|book antiqua|"book antiqua")*;"
Replace = "font\2family:verdana;"

When the above filter is applied to this css:
http://graphics8.nytimes.com/css/0.1/scr.../forms.css
it's triggered no matter whether the () encloses the $TYPE restrictions or not. But if I add ^www.cnn.com to the end of it, the filter no longer works when the $TYPEs are enclosed with ().

I don't see why asking it not to filter a certain site would disable it on others.
Add Thank You Quote this message in a reply
Jan. 19, 2013, 05:44 PM
Post: #4
RE: Proper order for URL Match parameters
I think you need to add some parentheses. Try

($TYPE(htm)|$TYPE(css)|$TYPE(js))(^www.cnn.com)

Says: htm OR css OR js, for all sites NOT www.cnn.com*.


Quote:s1.zetaboards.com/ $TYPE(htm)|$TYPE(css)

Says: for s1.zetaboards.com/ the htm OR all site's css.
Of course, "all site's css" includes the css at s1.zetaboards.com/

Quote:$TYPE(htm)|$TYPE(css) s1.zetaboards.com/

Says: all site's htm OR the css at s1.zetaboards.com/.

Quote:So am I to conclude that order doesn't matter?

No.

HTH
Add Thank You Quote this message in a reply
[-] The following 1 user says Thank You to JJoe for this post:
zoltan
Jan. 20, 2013, 01:55 AM
Post: #5
RE: Proper order for URL Match parameters
Thanks. Now the behavior makes sense. It's really not a matter of "order" in the way I was thinking, but more that the OR character takes precedence as a separator forcing all the elements on the other side to be considered together. For some reason I had seen the $TYPEs as a unit separated from the URL.

Nice to know this though. I have a lot of filters that need to be corrected.
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: