过滤phpwind5.3论坛的adblockplus规则

今天第一次学写abp的过滤规则.本来我是连基本的html知识都没得.但是一直厌恶学校论坛的签名档,以前我到处留言求助,求人帮忙写一个gm脚本,stylish样式…但是一直没人搭理.所以决定自己写一个

菜鸟怎么办,硬着头皮上呗.先到http://adblockplus.org/en/filters看基本的写法.以前看见英语文档就发怵.这次我打开桌面词典,耐下心来认真看.果然查到了,过滤元素的规则.

Element hiding: basic rules

恩,写的很详细.我又结合了ff提供的查看选中部分源代码.比如以下两份不同人的签名档部分源码

<div class=”signature” style=”overflow: hidden; max-height: 300px;”><table width=”100%”><tbody><tr><td><marquee behavior=”alternate” scrollamount=”3″ width=”90%”><font size=”3″><span style=”color: rgb(102, 51, 204);”>长得比较英俊</span></font></marquee>< /td><td></td></tr></tbody></table></div>

长得比较英俊

还有一份

<div class=”signature” style=”overflow: hidden; max-height: 300px;”><table width=”100%”><tbody><tr><td><marquee behavior=”alternate” scrollamount=”3″ width=”90%”><font size=”3″><span style=”color: rgb(102, 51, 204);”>长得比较英俊</span></font></marquee>< /td><td></td></tr></tbody></table></div>

其中不难发现,共同的部分是<div class=”signature” style=”overflow: hidden; max-height: 300px;”><table width=”100%”>..虽然我不懂div class style这些是什么意思,但是根据例子就可以自己推断出#div(signature)可以过滤所有的签名档.一试,果然如此.

那么,过滤所有头像的呢?继续看头像部分源码

<div style=”padding: 10px 0pt;”><table style=”border: 0pt none ;” width=”98%” cellpadding=”0″ cellspacing=”0″>
<tbody><tr><td class=”tac” style=”border: 0pt none ; overflow: hidden;”><img src=”images/face/2.gif” border=”0″></td>
</tr></tbody></table>

</div><div style=”padding: 10px 0pt;”><table style=”border: 0pt none ;” width=”98%” cellpadding=”0″ cellspacing=”0″>
<tbody><tr><td class=”tac” style=”border: 0pt none ; overflow: hidden;”><img src=”http://bbs.stuhome.net/hack/pig/image/5.gif” width=”100″ border=”0″ height=”160″></td>
</tr></tbody></table></div>

可以发现,虽然看不见div class=***了,但是共同的部分是td class=***.于是应用规则 #td(tac)过滤之.

就这样学会了写第一条abp规则,非常easy,非常菜鸟的问题,而且我也没有理解其中的原理.但是毕竟我做到了,靠自己,自己再也不用在论坛菜鸟般的傻问,求大虾们有空给我写条规则什么的.下次我可以进一步尝试用firebug看看页面源代码,也许更方便.

一步一步来吧,虽然还留着一个网页让k帮我写 - -!


656条留言

  • At 2009.03.06 23:03,
    Warning: mysqli::mysqli() [function.mysqli-mysqli]: (HY000/2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /srv/public_html/df/wpmu/wp-includes/comment-template.php on line 1376

    Warning: mysqli::real_escape_string() [function.mysqli-real-escape-string]: Couldn't fetch mysqli in /srv/public_html/df/wpmu/wp-includes/comment-template.php on line 1377

    Warning: mysqli::query() [function.mysqli-query]: Couldn't fetch mysqli in /srv/public_html/df/wpmu/wp-includes/comment-template.php on line 1379

    Fatal error: Call to a member function fetch_row() on a non-object in /srv/public_html/df/wpmu/wp-includes/comment-template.php on line 1380