我个人常用的2个广告过滤规则

新手入门、经验交流

Moderator: cre

Forum rules
  • 软件自带帮助是最好的入门教程,请仔细阅读;在您掌握最基本知识前,我们没法帮助您
  • 提问前请先查阅软件帮助文件和论坛相关讨论
  • 查阅软件帮助和论坛相关讨论即可解决的问题帖将直接删除,以免浪费他人时间
  • 请学会如何提问,尽量将问题描述清楚,不明确的提问将被直接删除
Post Reply
woai3838338
Posts: 10
Joined: May 09 2008, 23:58

我个人常用的2个广告过滤规则

Post by woai3838338 »

第一个:网址过滤

bounds match:

Code: Select all

<a\s[^>]++href=*</a>|<img*>|<script*</script>|<iframe*</iframe>|<embed*</embed>|<input*>|<ilayer*</ilayer>|<object*</object>|<embed*/>
Matching Expression:

Code: Select all

*(href|src)\1=($AV($LST(AdUrlKey)))\2*
Replacement Text:

Code: Select all

<a title=\2><font face=arial color=red size=1>[\1]</font></a>
其中:AsUrlKey的内容
## 加*$LST(AdUrlKey)*ajs**/js/**softtop**.doubleclick.**/ad(s|v)*
## duotehtml过滤多特软件网的广告*/ad*
## popme过滤163两边挂着的flash,或者用关键字nadCouplet
## */gg*让sina下载网页显示不正确.排除ggcb,是金山词霸的图片导致的。
## */temp/**/portal/*阻止了新浪女人
## *clickeye*过滤163娱乐新闻具体网页中一些字上的广告
## js/base64.js迅雷下载
############通用规则~~~~~~~~~~~~~~~~~
*count(er|).*
*.imrworldwide.*
*/goods.php?id=*
*/brand.php?id=*
*/click.js?user_id=*
*/info.cnt?id=*\&referer=http*
*banner*
#*(/|_|-|.)ad\9&(^$TST(\9=(d|v(anc|ent|vice|vise))*))
#\9ad(_|-|)(id|(f|)show|txt|client|(f|)click|file|img|(s|)view|serve)*(^$TST(\9=*((h|r)e|(l|r)o)(^?)))
\9ad\8(^$TST(\9=*(l|r|p|(h|t|r)e|(l|r)o)(^?)))&(^$TST(\8=(d|v(anc|ent|vice|vise))*))
*(php|page|pop|js|show|google|end|popup|top)ad*
*rcv/click.php*
*affiliate.*
## 从Adkey过来
#*top[0-9]+{1,5}*
*((double|log_)click|click(thru|er|.pl|eye)|rotator[0-9]+{1,5})*
*((acc_random|_to|Ctx|banner|come|click|offer|r(ef|un)|s(ite|eed|ubproduct)|pal)(_|)(id|)=)*
*(webconnect.dll|(web|)sponsor|promo)*
*google(?|)analy*
############特定规则~~~~~~~~~~~~~
*/d[1-4].*
*/(pop|yixia|portal|temp|orsoon|guanggao)/*
*/gg*
*/cpro*
*area_lmt.js
*tongji.js
*input-ac.js
js/base64.js
*/gongyong.js*
*union.mop.com*
## *musicjs*
*ajs*
*pingjs*
## *duotehtml*
*newhuagg*(_ad|gg|21cn|real)*
*ma.baidu.com*
*wangmeng*
*alimama*
*d9cn*
*ebay*
*vod00*
*(popme|proimg|pro).*
*.juedui100.com*
*pfp*.sina*
*tuijianimg*
*p4p.cn.yahoo*
*image2.yesky.com*
*.downxia.com/images/*
*.cncrk.com/files/*
*39.net*
*softtop*
*tj.28.*
#*log.js
*static.cache*
*/duotehtml/*
*idm.cctv.com*
*51yes*
以上,就是我的这个规则,过滤网页中的一些广告链接。
大家也看到了,其中一些规则,我没有用。

第二个:网页中关于Class和Id属性的过滤

Matching Expression:

Code: Select all

<(\w)\1[^>]++\s(id|class|name)\3=($AV($LST(Ad-idClass)))\2[^>]++>$INEST(<$TST(\1)*>,</$TST(\1)>)</$TST(\1)>|
<(\w)\1[^><]++\s(id|class|name)\3=($AV($LST(Ad-idClass)))\2[^>]++>
Replacement Text:

Code: Select all

<font face=arial color=red size=1>[\1 \3=\2]</font>
其中:Ad-idClass的内容是:
\9ad\8(^$TST(\9=*(l|gr|p|sh|(h|l|t|r)e|(l|r)o)(^?)))&(^$TST(\8=(d|v(anc|ent))*))
*(to|ph|po|popu)pad*
*_gg*
*banner*
*follow*
*dfs*
*textlink*
*toplip*
*baidu*
*z_right_float*
*topgg*
#*foot*
## *Float_*
## 中关村在线
head_4 bd mt6
Al bd
Ar_1
以上两个可以过滤大部分网页中的广告。有兴趣的,可以试试。
纯属个人喜好。这些规则可能不适合你。希望不要见怪。
imsheng
Posts: 37
Joined: Jan 08 2008, 13:24

Re: 我个人常用的2个广告过滤规则

Post by imsheng »

第二条规则里的第一个匹配项

\9ad\8(^$TST(\9=*(l|gr|p|sh|(h|l|t|r)e|(l|r)o)(^?)))&(^$TST(\8=(d|v(anc|ent))*))

误杀严重。并,该条规则返回的变量不完整。会丢失。
Post Reply