- UID
- 109918
- 帖子
- 29
- 精华
- 0
- 贡献
- 3
- 推广
- 0
- 有效BUG
- 0
- 注册时间
- 2008-4-24
|
[过滤规则] 自制常见广告过滤规则 最后更新:2008-09-13
感谢凤凰工作室,没有它就没有TheWorld
感谢正则表达式,没有它就没有这些规则
写在前面的话:
1.由于本人能力有限,规则只能过滤掉一部分广告,并且对于产生的空白框架,我无能为力,请各位多多包涵.
2.请大家善用TheWorld的网站白名单功能(自己的邮箱,博客都可以填进去)
3.请大家善用TheWorld的禁止显示Flash功能(绝大多数Flash都是广告,看视频的时候再打开)
规则做了优化,可读性比较差...
VERSION 2008-09-13
- //数字组合
- #ex#<(I(?:MG|FRAME)|SCRIPT|EMBED|PARAM)\x20[^-_\\\/.?="'>]+(?:[-_\\\/.?="']+[^-_\\\/.?="'>]+)*?[-_\\\/.?="']+([1-9]\d{1,2}[-_xX][1-9]\d{0,1}[05])[-_\\\/.?="'&\x20][^>]*>(?:(?:(?!<\1\b)[\s\S]){0,512}?<]*?\1>)?###\\??\/[^>]*?\1>)?###<S STYLE="background:#EEE;color:#FFF;font-size:9pt" TITLE="$1">[$2]</S>
- //关键词
- #ex#<(A|SCRIPT|I(?:MG|FRAME)|EMBED|PARAM)\x20[^-_\\\/.?="'>]+(?:[-_\\\/.?="']+[^-_\\\/.?="'>]+)*?[-_\\\/.?="']+((?:360quan|9v|a(?:d(?:\d+|click|id|pictures|s(?:it)?|union|v(?:iew)?|)|l(?:i(?:mama|union)|l(?:4ad|yes\d*)))|b(?:anners?|iz5)|c(?:hinesefriendfinders?|l(?:ck?|ic(?:k(?:eye)?|))|p(?:[cdlmps]|v|ro))|d(?:annonces|otmore)|e(?:iv|te(?:un)?)|g(?:g(?:ao|img|)|o(?:cpc|oglesyndication)|uang(?:g(?:ao)?|))|h(?:ao(?:ei|ye)|eima8)|i(?:dc|focus)|j(?:iaoyou|oy)|keyrun|market|narrowad|p4p|qyule|s(?:ooe|pc(?:lick|ode)|tat)|tuotu|u(?:link|n(?:i(?:gg|on(?:sky)?)|stat|))|vo(?:done|gate)|webgame|y(?:eeyoo|igao)))[-_\\\/.?="'&][^>]*>(?:(?:(?!<\1\b)[\s\S]){0,512}?<]*?\1>)?###\\??\/[^>]*?\1>)?###<S STYLE="background:#EEE;color:#FFF;font-size:9pt" TITLE="$1">[$2]</S>
- //脚本
- #ex#<SCRIPT[^>]*>(?:(?!<\/SCRIPT>)[\s\S])*?(?:[-_/."'?=]|^)(google(?:syndication|_ad)|alimama|allyes|sogou_param|cpro)[-_/."'?=](?:(?!<\/SCRIPT>)[\s\S])*?<\/SCRIPT>###<S STYLE="background:#EEE;color:#FFF;font-size:9pt" TITLE="SCRIPT">[$1]</S>
复制代码
中间省略N多版本
VERSION 2008-05-27A版:显示被过滤的关键词和链接类型- #ex#<(A|SCRIPT|IFRAME|EMBED|IMG)[^>]+?(?:\.|\/|_)(a(?:2d|d(?:s?|s?click|tology|tools|union|\d{1,3})|l(?:imama|lyes\d*))|banner|gg|p4p|uni(?:gg|on(?:sys)?)|hao(?:ei|ye)|keyrun|googlesyndication|t2click|tuotu|vodone|yidaba|skype\d*|floatads?|firefox\.js|\w*gg\d*.js|(?:08|78|28|158|36578|89178|9v|360quan|c(?:hanet|o-cm|oopen)|p(?:v|hah)|yigao)\.c(?m|n)|pro(?:img)?\.163|(?:hc|ma)\.baidu|baidu\.com\/(?:baidu|cpro)|cpc\.sogou|ufile\.kuaiche|atm\.youku|biz5\.sandai|(?:s|p4)p\.tom)(?:\.|\/|"|_|\.js)[^>]*?>(?:[\s\S]*?(?:<)|)###\\?\/\1>)|)###<span style="background-color:Silver;color:White;font-size:9pt">[<$1>($2)]</span>
复制代码 B版:直接隐藏- #ex#<(A|SCRIPT|IFRAME|EMBED|IMG)[^>]+?(?:\.|\/|_)(?:a(?:2d|d(?:s?|s?click|tology|tools|union|\d{1,3})|l(?:imama|lyes\d*))|banner|gg|p4p|uni(?:gg|on(?:sys)?)|hao(?:ei|ye)|keyrun|googlesyndication|t2click|tuotu|vodone|yidaba|skype\d*|floatads?|firefox\.js|\w*gg\d*.js|(?:08|78|28|158|36578|89178|9v|360quan|c(?:hanet|o-cm|oopen)|p(?:v|hah)|yigao)\.c(?m|n)|pro(?:img)?\.163|(?:hc|ma)\.baidu|baidu\.com\/(?:baidu|cpro)|cpc\.sogou|ufile\.kuaiche|atm\.youku|biz5\.sandai|(?:s|p4)p\.tom)(?:\.|\/|"|_|\.js)[^>]*?>(?:[\s\S]*?(?:<)|)###
复制代码
(把预览图片删掉了,太占页面高度...)
各位如果觉得不错就加到黑名单里吧:lol:
[ 本帖最后由 狄烁stec 于 2008-9-14 14:06 编辑 ] |
-
1
评分人数
-
|