# FilterProxy Configuration file.
#
# Be aware that FilterProxy will automatically rewrite this file.
# It will also automatically reload this file if it detects that it
# has been modified, so there is no need to kill FilterProxy when
# editing by hand.
#
# This is a normal perl file, and will be eval'ed by FilterProxy
# to load it's configuration.  I recommend that initially, you use
# the forms interface to add stuff, and then look at this file to
# see its structure.

$FilterProxy::CONFIG = {
  'first_time' => 1,
  'http_proxy_password' => '',
  'info' => 1,
  'filtering' => 1,
  'logfile' => '/var/log/filterproxy/filterproxy.log',
  'localhostonly' => 1,
  'filters' => {
    'http://(\\w+\\.)*theonion\\.com' => {
      'Rewrite' => {
        'filters' => [
          'ONION: strip regex /<!--\\s+(?:BEGIN OnionAdExtractor|(?:Ad Table|Sponsors Area|\\d+x\\d+(?: and \\d+x\\d+) Ad Area) Begin)\\s+-->/ add regex /<!--\\s+(?:END OnionAdExtractor|(?:Ad Table|Sponsors Area|\\d+x\\d+(?: and \\d+x\\d+) Ad Area) End)\\s+-->/'
        ]
      }
    },
    'http://(\\w+\\.)*(slashdot\\.org|freshmeat\\.net|andover\\.net|freecode\\.com|ibooks\\.com|questionexchange\\.com|thinkgeek\\.com|davecentral\\.com|andovernews\\.com|mediabuilder\\.com|itmanagersjournal\\.com|internettrafficreport\\.com|techmailings\\.com|techsightings\\.com|slaughterhouse\\.com|newsforge\\.com|themes\\.org|linux\\.com|slashcode\\.com|geocrawler\\.com|linuxgram\\.com|openmagazine\\.net|osdn\\.com)' => {
      'Rewrite' => {
        'filters' => [
          '1_ANDOVER_ADLOG: strip tagblock <a href =~ #adlog.pl#> add balanced',
          '1_GREENDOT: rewrite tag <img src ="http://images.slashdot.org/greendot.gif"> as <spacer height=0 width=0>',
          '1_OSDN: strip tag <img src=~osdn_logo.gif> add encloser <table width="100%">',
          '1_ANDOVER: strip tag <img src =~ #http://(209.207.224|images[0-9]*.slashdot.org/(banner/|pagecount.gif|Slashdot/pc.gif))# > add encloser <table border=0 cellpadding=0 cellspacing=0> add balanced add whitespace'
        ]
      }
    },
    'http://.*\\.js$' => {
      'Rewrite' => {
        'filters' => [
          '0_JAVASCRIPT: strip regex /^.*doubleclick\\.net.*$/',
          'IGNORE_ADS: ignore ADS'
        ]
      }
    },
    'http://(\\w+\\.)*sciencemag\\.org' => {
      'Rewrite' => {
        'filters' => [
          'SCIENCE_TOPAD: strip tagblock <a href=~/adclick/> add balanced add encloser <table>'
        ]
      }
    },
    'http://(\\w+\\.)*prohosting\\.com' => {
      'Rewrite' => {
        'filters' => [
          'PROHOSTING: strip regex #(?<=</html>).*#'
        ]
      }
    },
    'http://(\\w+\\.)*zdnet\\.com' => {
      'Rewrite' => {
        'filters' => [
          'ZDNET: strip tagblock <a href=/ads[0-9]+\\.zdnet\\.com/> add encloser <table> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*altavista\\.com' => {
      'Rewrite' => {
        'filters' => [
          'ignore ADSERVERS',
          '1ALTAVISTA: strip tagblock </a|img|i?layer|i?frame|script/ src =~ /(linkexchange|flycast|clicktrade|doubleclick|avenuea|blockstackers|mediaplex|focalink|valueclick|imgis|bfast|admaximize|eads|datis|commission-junction|pennyweb|linkbuddies|preferences|dimeclicks|futurenet|247media|netadsrv\\.iworld|clk4|spanishbanner|hibtox|burstnet|swiftad|adzerver|hamster)\\.(com|net)/> add encloser </script|table|form/> add balanced add alternate'
        ]
      }
    },
    '.*' => {
      'Compress' => {},
      'Rewrite' => {
        'filters' => [
          'TABLEADS: strip tagblock </a/ href=~/(clk4|hamster)\\.com/> add encloser <table> add balanced add alternate',
          'WEBBUGS: rewrite tag <img /width/=1 /height/=1> add encloser </(no)?script/> add alternate as <spacer width=1 height=1>',
          'SCRIPTS2: strip tagblock <script src=~/banner/> add balanced add alternate add balanced',
          'DUNNO: strip tagblock <ilayer name=userban visibility=hide> add regex </layer> add alternate add balanced',
          'FONTS: rewrite attrib <font size=1> as size="-1"',
          'SCRIPTADS: strip regex #(ads\\.freecity\\.de|flycast\\.com|/RealMedia/ads/)# inside tagblock <script> add encloser <script> alternate add balanced',
          'JSPOPUPS: rewrite regex /(?:window\\.)?open\\(/ inside tagblock <script> as eval("null //" +',
          '1_COMDELADS: strip regex /<!--[^>]*(?:Auto Banner Insertion Begin|(?:begin|start) (?:engage media )?ad|START TrafficMarketPlace POPUNDER|FASTCLICK.COM (?:(?:POP-UNDER|STATS) CODE )?v[0-9\\.a-z]+ for|begin banner ad|Advertising.com Banner Code|Advert Block)[^>]*-->/ add regex /<!--[^>]*(?:Auto Banner Insertion Complete THANK YOU|end (?:engage media )?ad|END TrafficMarketPlace POPUNDER|FASTCLICK.COM (?:POP-UNDER CODE )?v[0-9\\.a-z]+ for|end banner ad|Copyright [0-9]+, Advertising.com|End of Advert Block)[^>]*-->/ add balanced',
          'ADS: strip tagblock </(?:a|img|i?layer|i?frame|script|form|embed)/ /(?:src|href|action)/ =~ %(?x) # I use the m//x construct to extend this rule with whitespace.
(?:

    (?: # Suspicious script paths
        /ad(?:cafe|_|click|buy|count(?:er)?|content|s)?
        (?:\\.(?:cgi|php[0-9]?|asp|pl|[sp]html)|AdClient|Clicker|serv|link|click|verts?|log|graphic|banner|source|mosaic|intelligent)
        |blipverts?
        |/(?:ad|ad(?:s|-bin|buy|images?)?|ajrotator)/    # directory names
        # Banners can sometimes be legitimate.  
        # So it has to: (1) be a script, (2) involve "click" or (3) be a redirect
        |banners?
        (?:
            \\.(?:cgi|php[0-9]?|asp|pl|[sp]html)
            |man
            |click
            # Redirects can sometimes be legitimate.  
            # Must have AD= get-style parameter (as well as come after banner/).
            |/redirect(?:\\.(?:cgi|html|perl|pl|php[0-9]?|[sp]html|asp)\\?AD)
        )
        |/(?:event|html)\\.ng/
        |servfu\\.pl
        |/ads?[\\._]
        |(?:images?_?|click_.x\\.|adstream_.x\\.)ads?
        |sponsor
        |phpAds
        |_ad\\.html
        |click-through
        |www.amazon.com/exec/obidos/redirect-home
        |prohosting.com/click
        |\\.ad\\?
        |obj=(?:ADVERT|ADNAV|AMAZON) # from linux.org
        |/impression/\\?
        |track.cfm\\?BannerID=
    )
    # Hostnames that look like ad servers
    |http://(?:\\w+\\.)?(?:remote|i)?ad(?:s|s?[0-9]+|server|images?|redir(?:ect)?|_?click|content)?\\.
    # Known ad domains
    |(?:    
        (?: # .com/.net domain
            link4link
            |linkexchange
            |flycast
            |clicktrade
            |doubleclick
            |avenuea
            |blockstackers
            |mediaplex
            |focalink
            |valueclick
            |onresponse
            |imgis
            |admaximize
            |eads
            |datis
            |commission-junction
            |pennyweb
            |rankyou
            |linkbuddies
            |preferences
            |dimeclicks
            |futurenet
            |247media
            |netadsrv\\.iworld
            |clk4
            |spanishbanner
            |hibtox
            |burstnet
            |swiftad
            |adzerver
            |hamster
            |ukbanners
            |spunkmedia
            |namezero
            |ecoupons
            |spinbox
            |adclub
            |advertising
            |hitbox
            |websidestory
            |link4ads
            |bfast
            |gameadexchange
            |adbureau
            |linksynergy
            |superstats
            |st21\\.yahoo
            |phoenix-adrunner\\.mycomputer
            |counter\\.xoom
            |\\w+ads\\.osdn
            |euniverseads
            |popuptraffic
            |iadnet
            |adscholar
            |hightrafficads
            |trafficmarketplace
            |qksrv
            |fastclick
            |webstormmedia
            |adultrevenueservice
            |maximumcash
            |atwola
        )\\.(?:com|net)
        |(?:adexit|freecity)\\.de
        |(?:168.143.172.74))
    )
%> add encloser </(?:(?:no)?script|object)/> add balanced add alternate add balanced add whitespace'
        ]
      },
      'Header' => {
        'add' => '',
        'remove' => [
          'title',
          'x-meta.*'
        ],
        'allow' => ''
      },
      'DeAnim' => {}
    },
    'http://(\\w+\\.)*securityportal.com' => {
      'Rewrite' => {
        'filters' => [
          'SECURITYPORTAL: strip regex /<!--[^>]*Advertisement[^>]*-->/ add encloser <tr>'
        ]
      }
    },
    'http://source/\\?.*' => {
      'Source' => {},
      '-Rewrite' => {}
    },
    'http://(\\w+\\.)*libertyboard\\.org' => {
      'Rewrite' => {
        'filters' => [
          'LIBERTYBOARD: strip tagblock <a href=~#/banners.php.op=click#> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*((8m|freeservers|8k|4t|s5|itgo|iwarp|4mg|faithweb|tvheaven|htmlplanet|scriptmania)\\.com|(8m|freehosting)\\.net|gq\\.nu)/' => {
      'Rewrite' => {
        'filters' => [
          '8M: strip tagblock <ilayer name=userban> add encloser <script> add alternate add balanced',
          '8M_DELIMITED: strip regex /<!-- Auto Banner Insertion Begin -->/ -growto regex /<!-- Auto Banner Insertion Complete THANK YOU -->/'
        ]
      }
    },
    'http://(\\w+\\.)*imdb\\.com' => {
      'Rewrite' => {
        'filters' => [
          'IMDB_AD2: strip tag <img alt=~/Advert|Available/> add encloser <table>'
        ]
      }
    },
    'http://(\\w+\\.)*yahoo\\.com' => {
      'Rewrite' => {
        'filters' => [
          'YAHOO_JC: strip regex /<!-- +_JC_ +(ADCALL|TAD) +-->/ add regex /<!-- +_JC_ +END +(ADCALL|TAD) +-->/',
          'ignore ADNAMES ADSERVERS ADSERVPATS SCRIPTS TEXTADS',
          'YAHOO_POPUNDER: strip tagblock <script language=javascript src=~#/popunders/#>',
          'YAHOO: strip regex /<!-- +(SpaceID=[0-9]+ +)?(loc=)?NW +(noad +)?-->/ add encloser <table width=~/(?:625|675)/> add leader <p>',
          'ignore ADNAMES ADSERVERS ADSERVPATS SCRIPTS TEXTADS ADS TABLEADS',
          'YAHOO_JAVA: strip regex /ADVERTISEMENT/ inside tagblock <font> inside tagblock <table> add encloser <table>',
          'YAHOO_UNNAMED: strip tagblock </a|area|form/ /action|href/=~#rd\\.yahoo\\.com/(M=[0-9\\.]+/|D=[a-zA-Z_]+/|S=[0-9A-Z:]+/|P=[a-z0-9]+/|A=[0-9]+/|R=[0-9]+/){3,}[\\*\\?]https?:#>  add balanced add encloser <tr> add balanced add whitespace',
          'YAHOO_TABLE: strip regex /ADVERTISEMENT/ add balanced preceeding tagblock <table> add tagblock <table> containing regex /Weekly Specials/ add balanced add whitespace'
        ]
      }
    },
    'http://(\\w+\\.)*pbs\\.org' => {
      'Rewrite' => {
        'filters' => [
          'PBS_THANKSTO: strip tag <img src=~/banner_thanks.gif/> add encloser <table> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*space\\.com' => {
      'Rewrite' => {
        'filters' => [
          'SPACE: strip tag <img src=~/blackpx.gif/> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*sourceforge\\.net' => {
      'Rewrite' => {
        'filters' => [
          '1_SF_ADBAR: strip tag <img src=/adserver.phtml/> add encloser <table>',
          '1_OSDN: strip tag <img src=~/sfads.osdn.com/> add encloser <table>'
        ]
      }
    },
    'http://(\\w+\\.)*alphalinux\\.org' => {
      'Rewrite' => {
        'filters' => [
          'BANNER: strip tagblock </img|i?layer|i?frame/ src =~ #/banners?/#> add encloser <script> add balanced add alternate add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*webvan\\.com' => {
      'Rewrite' => {
        'filters' => [
          'ignore SCRIPTS',
          'ignore WEBBUGS'
        ]
      }
    },
    'http://(\\w+\\.)*nytimes\\.com' => {
      'Rewrite' => {
        'filters' => [
          'NYT_AD: strip tagblock <NYT_AD> add balanced',
          '1_THIRD_PARTY_AD: strip regex /<!--THIRD_PARTY_AD-->/ add regex /<!--END_AD-->/',
          'NYT_AD2: strip regex #www.nytimes.com/ads/# add encloser <tr>'
        ]
      }
    },
    'http://(\\w+\\.)*(washingtonpost|newsbytes)\\.com' => {
      'Rewrite' => {
        'filters' => [
          '1_WP_ADBOX: strip tag <img src="/images/ad_bigbox.gif"> inside tagblock <table width="310" height="276"> add encloser <table>'
        ]
      }
    },
    'http://(\\w+\\.)*ebay.com' => {
      'Rewrite' => {
        'filters' => [
          'EBAY: strip regex /ad_tag\\("\\w+"\\);/ add encloser <script> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*upside\\.com' => {
      'Rewrite' => {
        'filters' => [
          'UPSIDE: strip regex #<!-*LeftNav-*--># add tagblock <table>',
          'UPSIDE2: strip regex #<B>Sponsored Links:</B># add encloser <table> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*weather\\.com' => {
      'Rewrite' => {
        'filters' => [
          'WEATHER_ARROW: strip tag <img src=~/clickhere_arrow/> add encloser <table> add balanced',
          'WEATHER_ADCOL: strip tagblock <a href=~/ads/> add encloser <table> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*insanehardware\\.com' => {
      'Rewrite' => {
        'filters' => [
          'INSANEHARDWARE: strip regex #http://www.insanehardware.com/images/advert# add encloser </script/> add alternate add balanced',
          'INSANEHARDWARE_IMG: strip tag <img src=~#/affiliates/#> add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*(aceshardware|doomworld).com' => {
      'Rewrite' => {
        'filters' => [
          'IG_ADNAMES: ignore ADNAMES',
          'IG_ADSERVPATS: ignore ADSERVPATS',
          'UGO: strip tag <img src =~ /ugo/ width="55" height="60"> add balanced add alternate',
          'UGO_AD: strip tagblock </iframe|img|script/ src=~/adserver.ugo.com/> add balanced add alternate',
          'UGO_AD2: strip tagblock <a href=~#http://www.ugo.com#> add alternate add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*angelfire\\.com' => {
      'Rewrite' => {
        'filters' => [
          'ANGELFIRE_POPUP: strip regex /<!-- Beginning of Angelfire Ad Code Insertion -->/ add regex /<!-- End of Angelfire Ad Code Insertion -->/'
        ]
      }
    },
    'http://\\w+\\.go\\.com' => {
      'Rewrite' => {
        'filters' => [],
        'adregexp' => [
          'ngads\\.go\\.com'
        ]
      }
    },
    'http://(\\w+\\.)*geocities\\.com' => {
      'Rewrite' => {
        'filters' => [
          'GEOCITIES_MBE: strip tag <img src=~#http://pic.geocities.com/images/mbe#> add encloser <table> add balanced',
          'GEOCITIES_YBEACON: strip tagblock <script src=~#www.geocities.com/js_source/#> add balanced',
          'GEOCITIES_SERV: strip tag <img src=~#http://geo.yahoo.com/serv#> add encloser <script> add encloser <script> add balanced add alternate',
          'GEOCITIES_VISIT: strip tag <img src=~#http://visit.geocities.com/visit.gif#> add balanced add alternate',
          'GEOCITIES_TOTO: strip tagblock <script src=~#http://[\\w\\.]*geo(?:cities)?.yahoo.com/toto#> add encloser <table> add balanced add alternate add balanced',
          'GEOCITIES_TOTO2: strip regex #window.open\\(\'http://[\\w\\.]*geo(?:cities)?.yahoo.com/toto# add encloser <script> add balanced add alternate',
          '1_GEOCITIES_TOTO3: strip regex #<!-- +<service name="?toto"?> +--># add regex #<!-- +</service> +-->#',
          'GEOCITIES_DELIMITED: strip tagblock <script> add regex /<!-- text above generated by server. +PLEASE REMOVE -->/',
          'GEOCITIES_DELIMITED2: strip regex /<!-- text below generated by server. +PLEASE REMOVE -->.*/'
        ]
      }
    },
    'http://(\\w+\\.)*tripod\\.com' => {
      'Rewrite' => {
        'filters' => [
          'TRIPOD: strip regex /Tripod(?:Show)?Popup/ add encloser <script> add alternate add balanced'
        ]
      }
    },
    'http://(\\w+\\.)*linuxdevices\\.com' => {
      'Rewrite' => {
        'filters' => [
          '1_LD_ZDNET: strip regex /<!-- Banner Ad start =* -->/ add tagblock <table>'
        ]
      }
    },
    'http://(\\w+\\.)*(dilbert|comics|unitedmedia)\\.com' => {
      'Rewrite' => {
        'filters' => [
          'DILBERT: strip regex /<!-- -- --Enhanced Creative -- -- -->/ add regex /<!-- -- --End Enhanced Creative -- -- -->/
'
        ]
      }
    },
    'http://(\\w+\\.)*pcworld\\.com' => {
      'Rewrite' => {
        'filters' => [
          'PCWORLD_BOXAD: strip tagblock <table border="0" cellspacing="0" cellpadding="0" width="348" aligh="right"> containing regex /Advertisement/'
        ]
      }
    },
    'http://(\\w+\\.)*cnet\\.com' => {
      'Rewrite' => {
        'filters' => [
          'ignore WEBBUGS'
        ]
      }
    },
    'http://(\\w+\\.)*(neoseeker|arstechnica)\\.com' => {
      'Rewrite' => {
        'filters' => [
          'MAXIMUMPC: strip tagblock <a href=#http://www.maximumpc.com# target=_blank> add encloser <table>'
        ]
      }
    }
  },
  'timeout' => '600',
  'authenable' => 0,
  'timing' => 0,
  'users' => {
  },
  'http_proxy_username' => '',
  'mime_types' => [
    'text/html',
    'text/javascript',
    'application/x-javascript'
  ],
  'http_proxy' => '',
  'debug' => 0
};

$FilterProxy::Compress::CONFIG = {
  'min_size' => 1024,
  'order' => [
    -10,
    1,
    9
  ],
  'transfer_encoding' => 0,
  'mime_types' => [
    'text/html',
    'text/plain',
    'application/postscript',
    'application/pdf',
    'application/x-javascript'
  ]
};

$FilterProxy::DeAnim::CONFIG = {
  'order' => 4,
  'mime_types' => [
    'image/gif'
  ]
};

$FilterProxy::Header::CONFIG = {
  'dump_headers' => 1,
  'order' => [
    -10,
    10
  ],
  'mime_types' => [
    ''
  ]
};

$FilterProxy::ImageComp::CONFIG = {
  'order' => 4,
  'mime_types' => [
    'image/jpeg',
    'image/jpg'
  ]
};

$FilterProxy::Rewrite::CONFIG = {
  'order' => 4,
  'mime_types' => [
    'text/html',
    'application/x-javascript'
  ]
};

$FilterProxy::Skeleton::CONFIG = {
  'order' => 4,
  'mime_types' => [
    'text/html',
    'text/plain'
  ]
};

$FilterProxy::Source::CONFIG = {
  'order' => [
    -10,
    10
  ],
  'mime_types' => [
    ''
  ]
};

$FilterProxy::XSLT::CONFIG = {
  'order' => 6,
  'mime_types' => [
    'text/html',
    'text/xml'
  ]
};
1;
