Author Topic: Kill ad tables  (Read 6689 times)

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Kill ad tables
« on: April 26, 2002, 01:17:22 PM »
I'm tired of seeing tables filled with ad links... they're more and more common at image galleries. This filter removes the entire content of a <td> or <th> if it contains an ad link. I've been tweaking this filter all day, and think it's now finally useful (as in it does not trigger too often on pages it shouldn't). Should you encounter pages that mix ad content with actual content inside one element, just place them in the SkipTables blocklist, and this filter will leave that page alone.
Name = "Kill ad tables"
Active = TRUE
URL = "(^$LST(SkipTables))"
Bounds = "$NEST(<th*,*,</th>)|$NEST(<td*,*,</td>)"
Limit = 2048
Match = "(*href=$AV(*://($LST(AdList))1*)*)>*</a*"
Replace = "<span class="prox" kill="Ad Table" detail="1" reason="9"></span>"
If you edit your prox.css to comment out the pseudo-classes .prox:before and .prox:after, the ad tables will completely disappear

Check the "Other" forum for my current prox.css

Edited by - Jor on 26 Apr 2002  15:41:24
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Kill ad tables
« Reply #1 on: May 12, 2002, 11:29:48 PM »
This filter might corrupt page layout, improved version below:
Name = "Kill ad tables"
Active = TRUE
URL = "(^$LST(SkipTables))"
Bounds = "$NEST(<th,</th>)|$NEST(<td,</td>)"
Limit = 2048
Match = "<t(h|d)(*)1>(*href=$AV(*://($LST(AdList))2*)*)>*</a*"
Replace = "<td1><span class="prox" kill="Ad Table" detail="2" reason="9"></span></td>"


 
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Kill ad tables
« Reply #2 on: May 13, 2002, 02:35:25 AM »
Great work Jor! This works great.

--------

"Imagination is more important than knowledge" - Einstein

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Kill ad tables
« Reply #3 on: May 17, 2002, 06:34:08 PM »
Small alteration:
Name = "Kill ad tables"
Active = TRUE
URL = "(^$LST(SkipTables))"
Bounds = "$NEST(<th,</th>)|$NEST(<td,</td>)"
Limit = 2048
Match = "<t(h|d) (*2)>(*href=$AV(*://($LST(AdList))1*)*)>*</a*"
Replace = "<td class="proxtable" 2><span kill="Ad Table" detail="1" reason="9"></span></td>"

Also create this entry in your prox.css:
.proxtable
{
  display: none !important;
}

Now the table layout will be preserved (important if colspan or rowspan is used), but the cell itself will be hidden completely :)

 
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Kill ad tables
« Reply #4 on: May 17, 2002, 07:42:17 PM »
This version causes my CPU to go through the roof, which in turn, causes slower page loads.


EXAMPLE:http://www.pcnineoneone.com/cgi-bin/dcforum/dcboard.cgi?az=list&forum=computer&mm=0&archive=

--------

"Imagination is more important than knowledge" - Einstein

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Kill ad tables
« Reply #5 on: May 17, 2002, 08:47:13 PM »
Is this slowdown new to this version of the filter? I can't see what would cause it to be so much slower... but you are right about the CPU usage (Mine goes to 60%). I'll test some alternatives...

Would you have any idea why it is so much worse?

 
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Kill ad tables
« Reply #6 on: May 17, 2002, 09:13:36 PM »
Yes, only in the new version. I'll take a peek right now..

--------

"Imagination is more important than knowledge" - Einstein

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Kill ad tables
« Reply #7 on: May 17, 2002, 09:15:09 PM »
Think I found it -- change it to this:
Name = "Kill ad tables"
Active = TRUE
URL = "(^$LST(SkipTables))"
Bounds = "$NEST(<th,</th>)|$NEST(<td,</td>)"
Limit = 2048
Match = "<t(h|d)(*)1>(*href=$AV(*://($LST(AdList))2*)*)>*</a*"
Replace = "<td class="proxtable" 1><span class="prox" kill="Ad Table" detail="2" reason="9"></span></td>"
Apparently changing (*)1 to (*1) was a mistake *L*

The above version ought not slow down your PC, but still can hide the tables entirely.

[Edit: ought now = ought not

Edited by - Jor on 17 May 2002  22:21:46
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Kill ad tables
« Reply #8 on: May 17, 2002, 09:23:41 PM »
Ah great, that fixed it. Thx Jor.

--------

"Imagination is more important than knowledge" - Einstein

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Kill ad tables
« Reply #9 on: June 03, 2002, 12:03:56 PM »
Sligthly modified version, is a little faster:

[Patterns]
Name = "Kill ad tables"
Active = TRUE
URL = "$TYPE(htm) & (^$LST(SkipTables))"
Bounds = "$NEST(<th,</th>)|$NEST(<td,</td>)"
Limit = 2048
Match = "<t(h|d)(*)1>(*href=$AV(*://($LST(AdList))2*)*)>*</a*"
Replace = "<td class="proxtable" 1><span class="prox" detail="2" "
          "reason="9" kill="Ad Table"></span></td>
"


A few entries from my SkipTables list:
# Proxomitron4 URL killfile: $LST(SkipTables)
#
# by Jor
#
#
# Blocklist for use with my "Kill Ad Table" filter.
# This file lists sites which mix ad content with real content, where using
# my filter may kill site navigation.
#

[^/]++slashdot.org/article.pl
[^/]++hotmail.(*.)com/
www.adventurers-comic.com/d/
pewfell.keenspace.com/
[^/]++yahoo.com/


As you can see by going to the sites (especially Yahoo), this filter can kill navigation unless you use the blocklist. (More like an allowlist here )



Edited by - Jor on 18 Jun 2002  15:35:19
 

hpguru

  • Sr. Member
  • ****
  • Posts: 257
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://lightning.prohosting.com/~hpguru/
    • Email
Kill ad tables
« Reply #10 on: June 16, 2002, 09:48:15 PM »
I know this isn't the proper board for site specific filter but since ad tables are being discussed, here goes.

I have a quick fix of a filter I have been using only at Ezboard where they are inserting huge ad tables with some closing tags missing which makes them hard to filter. So in an effort to catch everything I wrote this filter and so far it is doing the trick. It deletes every visible trace of the tables fairly quickly without disrupting page layout or having to use excessive byte limits.



Name = "Kill Ezboard Ad Tables"
Active = TRUE
URL = "[^/]++ezboard.com/"
Bounds = "<(table|th|td|tr)*/(table|th|td|tr)>"
Limit = 2560
Match = "*$LST(AdList)*"


Facing each other,
a thousand miles apart.
Facing each other,
a thousand miles apart.

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Kill ad tables
« Reply #11 on: July 23, 2002, 02:07:59 PM »
Minor update:

Code:
Name = "Kill ad table cells"
Active = TRUE
URL = "$TYPE(htm) & (^$LST(SkipTables))"
Bounds = "$NEST(<th,</th>)|$NEST(<td,</td>)"
Limit = 2048
Match = "<t(h|d)((*((row|col)span)1=$AV(2))|)*>"
        "(*href=$AV(*://($LST(AdList))3*)*)>*</a*"
Replace = "<td class="proxtable" 1=2 height=0 width=0><span "
          "class="prox" detail="3" reason="9" kill="Ad Table">"
          "</span></td>
"


Changes from last version are that only row or colspan are reserved, and cells are minimized.

 
 

JD5000

  • Full Member
  • ***
  • Posts: 241
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://home.satx.rr.com/jd5000/
    • Email
Kill ad tables
« Reply #12 on: July 23, 2002, 03:00:40 PM »
Thx Jor. I'm gonna give it a try.

--------
Infopros Joint :: Computer Related Links And Discussion