Post Reply 
Tweak for Manage: Specific Containers on sel. Sites
Jul. 10, 2009, 12:28 PM (This post was last modified: Jul. 19, 2009 02:24 PM by sh8an.)
Post: #1
Tweak for Manage: Specific Containers on sel. Sites
small clarification needed again for Manage: Specific Containers on sel. Sites 9.01.29 [sd] (d.2)
i have a ([^/]++.|)etoday.ru/ $SET(sAdKey=.sr.sidebar-links.) line in my user file
for some reason the sidebar-links and one of the sr containers are hidden instead of stripped
how do i stop it from doing that and just stripping all of them?

another question popped up Wink
there are several containers
$SET(sAdKey=.right.)$SET(sAdKeyR=<!--protect:right non_b-->)
id of the second one is exactly like that, with a space in it
keeping it is not critical but preferable... at the moment containers, even with just "right" as id are protected.
Add Thank You Quote this message in a reply
Jul. 11, 2009, 03:49 AM
Post: #2
RE: Blocklist Additions
(Jul. 10, 2009 12:28 PM)sh8an Wrote:  for some reason the sidebar-links and one of the sr containers are hidden instead of stripped

That might happen when the container's size go beyond the filter's byte limit.

(Jul. 10, 2009 12:28 PM)sh8an Wrote:  how do i stop it from doing that and just stripping all of them?

Increase the byte limit, but that might impact the performance.

(Jul. 10, 2009 12:28 PM)sh8an Wrote:  there are several containers
$SET(sAdKey=.right.)$SET(sAdKeyR=<!--protect:right non_b-->)
id of the second one is exactly like that, with a space in it
keeping it is not critical but preferable... at the moment containers, even with just "right" as id are protected.

Does this help?
Code:
$SET(sAdKey=.right(^ non_b).)
Add Thank You Quote this message in a reply
Jul. 11, 2009, 12:49 PM
Post: #3
RE: Blocklist Additions
(Jul. 11, 2009 03:49 AM)whenever Wrote:  That might happen when the container's size go beyond the filter's byte limit.
Increase the byte limit, but that might impact the performance.
thanks. only increasing the byte limit to 17000 solved the issue with all of the containers. how much do you think it would impact performance?

(Jul. 11, 2009 03:49 AM)whenever Wrote:  Does this help?
Code:
$SET(sAdKey=.right(^ non_b).)
just simple negation did not work. remember seeing somewhere that this filter can work with just partial id or class. i think it needs a look ahead in the protect section.
Add Thank You Quote this message in a reply
Jul. 12, 2009, 03:08 AM
Post: #4
RE: Blocklist Additions
(Jul. 11, 2009 12:49 PM)sh8an Wrote:  thanks. only increasing the byte limit to 17000 solved the issue with all of the containers. how much do you think it would impact performance?

Thinking about a 20000 byte container, the final result will be the same as hiding the container, no matter you set the byte limit to 5000 or 17000. However, before prox pass the content to the browser, it has to scan the amount of bytes you specified in the byte limit , so the original 5000 should be quicker than your 17000.

On the other hand, I think these performance difference may be ignored for modern computers.

(Jul. 11, 2009 12:49 PM)sh8an Wrote:  just simple negation did not work.

Have you tested it or could you give me a URL to test?

(Jul. 11, 2009 12:49 PM)sh8an Wrote:  remember seeing somewhere that this filter can work with just partial id or class. i think it needs a look ahead in the protect section.

I think the negation doesn't prevent the expression to match other strings started with "right" as long as it is not followed by " non_b".
Add Thank You Quote this message in a reply
Jul. 15, 2009, 08:19 AM
Post: #5
RE: Blocklist Additions
(Jul. 12, 2009 03:08 AM)whenever Wrote:  
(Jul. 11, 2009 12:49 PM)sh8an Wrote:  just simple negation did not work.

Have you tested it or could you give me a URL to test?

Well, I made a test and it seems to use negation in a variable and then test it won't work.

Below code works without using a variable
Code:
$SET(1=abc)$TST((\1)=abc(^d)*)

Below code won't work when using a variable
Code:
$SET(1=abc)$SET(sAdKey=abc(^d))$TST((\1)=$TST(sAdKey)*)

It works if we don't use negation in the variable
Code:
$SET(1=abc)$SET(sAdKey=abc)$TST((\1)=$TST(sAdKey)*)

So, my previous suggestion about using $SET(sAdKey=.right(^ non_b).) won't work, sorry. Sad
Add Thank You Quote this message in a reply
Jul. 15, 2009, 12:42 PM
Post: #6
RE: Blocklist Additions
whenever: thanks for the effort anyway Wink
i think in the filter itself protect sequence should just be stricter and ungreedy, while keeping the strip sequence greedy.
Add Thank You Quote this message in a reply
Jul. 15, 2009, 03:51 PM
Post: #7
RE: Blocklist Additions
Below codes would work:

Code:
$SET(1=abc(^d))$SET(sAdKey=abc(^d))$TST((\1)=$TST(sAdKey))
or
$SET(1=abc?+)$SET(sAdKey=abc?+)$TST((\1)=$TST(sAdKey))

I am going to get a conclusion: all meta characters assigned to variables lost their special meaning and are literal.

sh8an Wrote:i think in the filter itself protect sequence should just be stricter and ungreedy
Agree. This would give user more accurate control, or let's wait to see if sidki has better idea Wink
Add Thank You Quote this message in a reply
Jul. 15, 2009, 04:34 PM
Post: #8
RE: Blocklist Additions
Global variables in Proxomitron can hold strings but not expressions.

I've yet to see an ID attribute string containing spaces. If a class attribute string contains spaces, these spaces are separating different classes.

While you can add multiple dot separated substrings to the "sAdKey" variable, the filter expects just one class per substring. The filter is appending an asterisk to each substring, turning it into an expression with a trailing - in Perl terms "lazy" - wildcard.

The optional string after "protect:" in "sAdKeyR" must be exact. Lazy/greedy don't apply. That string must also appear as substring in "sAdKey".


If going beyond general considerations, into specific problems, example links are mandatory.
Add Thank You Quote this message in a reply
Jul. 16, 2009, 01:43 AM
Post: #9
RE: Blocklist Additions
(Jul. 15, 2009 04:34 PM)sidki3003 Wrote:  That string must also appear as substring in "sAdKey".
Example: http://www.baidu.com

There are three elements with their id started with "l"

Code:
<img src=http://www.baidu.com/img/baidu_logo.gif width=270 height=129 usemap="#mp" id=lg>

<table cellpadding=0 cellspacing=0 id=l>

<table cellpadding=0 cellspacing=0 id=lk><tr><td></td></tr></table>

How to remove only the element with its id is exactly "l" while leave the other 2 elements untouched?
Add Thank You Quote this message in a reply
Jul. 16, 2009, 08:03 AM (This post was last modified: Jul. 16, 2009 08:07 AM by sh8an.)
Post: #10
RE: Blocklist Additions
i just did not want to discuss my problem too much Wink in this thread, so exchanged info through PM.
here is a link example
http://photofile.ru/users/dedushka_v.fotoplenka/
and the filter set which i have tested
$SET(sAdKey=.c_right.rightWhite.bok.medialand_adland.pole_w(^ non_b).) - does not work
$SET(sAdKey=.c_right.rightWhite.bok.medialand_adland.pole_w.) - works.

PS
container in question is:
<div class="pole_w non_b">
in addition i've looked through the page source, they use a lot of similar code, for example just below that there is a <div class="pole_b non_t"> too.
Add Thank You Quote this message in a reply
Jul. 16, 2009, 04:15 PM (This post was last modified: Jul. 16, 2009 04:33 PM by sidki3003.)
Post: #11
RE: Blocklist Additions
Okay, let's try adding an "exact" modifier. Same all-or-one logic as with the other modifiers. Below filter is for the alpha.

Code:
[Patterns]
Name = "Manage: Specific Containers on sel. Sites     09.07.16 [sd] (d.0)"
Active = TRUE
URL = "$TST(hCT=*html)($LST(AdKeys-S)|$TST(sAdKey=*))"
Limit = 5000
Match = "<(div|form|h[1-6]|img|li|p|s(pan|tyle)|table|td|ul)\1\s"
        "(^$TST(comment=1)|$TST(tNoscript=1))([^>]++\s|)"
        "("
        "id=$AV(\4&$TST(sAdKey="
        ".(\6.$TST(\4=(($TST(\6)($TST(sAdKeyR=<!--exact(:$TST(\6)|--)*)|*))\7|*)))+"
        "))$SET(3=id)"
        "|class=$AV(\4&$TST(sAdKey="
        ".(\6.$TST(\4=(((*\s|)$TST(\6)($TST(sAdKeyR=<!--exact(:$TST(\6)|--)*)|*))\7|*)))+"
        "))$SET(3=class)"
        ")"
        ""
        "$TST(\7=*)("
        "(^$TST(sAdKeyR=<!--(hide|protect|strip_[a-z]+)\8(:$TST(\4)|--)*))"
        "$INEST(<$TST(\1),((^$TST(script=1*))|$TST(script=1*)(^*</script))*,</$TST(\1) >)</$TST(\1) >"
        "$TST(\1=td$SET(9=<td style=\0height:0;padding:0\0>)$SET(5=</td>)|*)"
        "|*>("
        "$TST(\8=protect$SET(5=\7)|strip_(all$SET(5=<\1>)|att$SET(5=<\1 \3="\4">)))"
        "|$SET(5=<\1 \3=\0\4\0 style=\0display:none!important\0>)($TST(\8=hide)|$SET(8=hidden))"
        ")$SET(2=-\8)"
        ")"
        ""
        "|<iframe\s"
        "([^>]++\s|)(id|class|name)\3=$AV($AV(\4&$TST(sAdKey=.(\6.$TST(\4=(($TST(\6)*)\7|*)))+)))"
        "$TST(\7=*)*>("
        "(^$TST(sAdKeyR=<!--(hide|protect|strip_[a-z]+)\8(:$TST(\4)|--)*))"
        "(*</iframe >|)($TST(tIframe=1)$SET(tIframe=)|)"
        "|("
        "$TST(\8=protect$SET(5=\7)|strip_(all$SET(5=<\1>)|att$SET(5=<\1 \3="\4">)))"
        "|$SET(5=<\1 \3=\0\4\0 style=\0display:none!important\0>)($TST(\8=hide)|$SET(8=hidden))"
        ")$SET(2=-\8)$SET(tIframe=$GET(tIframe)1)"
        ")$SET(1=iframe)"
        ""
        "&&\7&($TST(script=*)|$SET(0="))"
        "&($TST(volat=*.log:2*)$ADDLST(Log-Main,[$DTM(d T)]\tWEB SiteSpec_\1\2 \t\3 \4 \t\u)|)"
Replace = "\9<span class=\0Prox&#x20;ProxCntS\0 style=\0display:$GET(displayD)\0>"
          "&#8226;&#160;SiteSpec-\1\2: \3 \4</span>$GET(sAdKeyR)\5"


whenever's case:
Code:
www.baidu.com/    $SET(sAdKey=.l.)$SET(sAdKeyR=<!--exact-->)

sh8an's case:
Code:
photofile.name/
  $SET(sAdKey=.c_right.rightWhite.bok.medialand_adland.pole_w.)
  $SET(sAdKeyR=<!--exact:pole_w-->)

edit: Thread split. Feel free to give it an appropriate name. Smile!
Add Thank You Quote this message in a reply
Jul. 20, 2009, 05:46 AM
Post: #12
RE: Tweak for Manage: Specific Containers on sel. Sites
am I correct in assuming that currently exact works with only one container name?
Add Thank You Quote this message in a reply
Jul. 20, 2009, 07:07 AM
Post: #13
RE: Tweak for Manage: Specific Containers on sel. Sites
<!--exact--> : Apply exact match to all class/id substrings listed in sAdKey.
<!--exact:foo--> : Apply exact match only to the "foo" class/id string among the substrings listed in sAdKey.
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: