Page 1 of 1

广告过滤求教!

Posted: Sep 14 2009, 20:28
by kuke666
小弟新手,刚学习,求教Ing~~~
刚学习了DDBB的 http://forum.proxomitron.cn/viewtopic.php?f=2&t=80
按照方式过滤,遇到难题~
过滤一个小说站广告~ http://www.94feifan.com/files/article/h ... 76901.html

Code: Select all

<div align="center">
  <table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
      <td><fieldset style='width:250;height:265;border:1px dashed #a6ccf9'><legend style="background-color:#e4ebf1;"><font color=blue style="font-style: normal; font-variant: normal; font-weight: normal; line-height: 160%; font-size: 12px; text-decoration: none"><font color=red>第一视频</font>[此广告位招租,QQ:232698199]</font></legend><SCRIPT 
src="http://busjs.vodone.cn/bus/ownerjs/advjs_37/37079/37079_41851_p7_.js"></SCRIPT></td>
      <td><fieldset style='width:250;height:260;border:1px dashed #a6ccf9'><legend style="background-color:#e4ebf1;"><font color=blue style="font-style: normal; font-variant: normal; font-weight: normal; line-height: 160%; font-size: 12px; text-decoration: none"><font color=red>广告②</font>[此广告位招租,QQ:232698199]</font></legend><SPAN id=adbanner_2> </SPAN></td>
      <td><fieldset style='width:250;height:260;border:1px dashed #a6ccf9'><legend style="background-color:#e4ebf1;"><font color=blue style="font-style: normal; font-variant: normal; font-weight: normal; line-height: 160%; font-size: 12px; text-decoration: none"><font color=red>广告③</font>[此广告位招租,QQ:232698199]</font></legend><SPAN id=adbanner_3> </SPAN></td>
    </tr>
  </table>
  <table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
      <td><fieldset style='width:760;height:100;border:1px dashed #a6ccf9'><legend style="background-color:#e4ebf1;"><font color=blue style="font-style: normal; font-variant: normal; font-weight: normal; line-height: 160%; font-size: 12px; text-decoration: none"><font color=red>广告④</font>[此广告位招租,QQ:232698199]</font></legend><SPAN id=adbanner_4> </SPAN></td>
<div align="center"><script type="text/javascript" src="http://www.94feifan.com/gg/gonggao.js"></script></div>
以上是需要过滤内容部分的源代码~像这种该使用哪种方式过滤呢??
望高手告诉方法~~

Re: 广告过滤求教!

Posted: Sep 14 2009, 20:57
by cre
<table width="770" border="0" cellspacing="0" cellpadding="0" align="center">
因为没有height,所以不用管它。

我觉得应该用

Code: Select all

[Patterns]
Name = "Fieldset"
Active = TRUE
Bounds = "$NEST(<fieldset*,</(legend|fieldset)>)"
Limit = 2000
Match = "*(*1px dashed*) & (*(#a6ccf9|#ff9966)*)*"
因为经常见这个东东,而且前后次序还不一定一样。

Re: 广告过滤求教!

Posted: Sep 14 2009, 21:08
by kuke666
why 的方式对我这种新手来说貌似太高深了~~不过真的很感谢~~

内容里因为没有重复的<div align="center"> 所以DDBB的那个方式就很适合我啦~~~ :lol: :lol:

Code: Select all

[Patterns]
Name = "94feifan"
Active = TRUE
URL = "$TYPE(htm)www.94feifan.com/files/article/html/*"
Limit = 1900
Match = "<div align="center">*</div>"
Replace = "<!-- 94feifan -->"

Re: 广告过滤求教!

Posted: Sep 14 2009, 21:16
by cre
<div align="center">当然可以了,只需要加个$URL()就行了。可以在match,也可以在$LST()。
不过除了在url,其他地方最好前面加个\w。

Re: 广告过滤求教!

Posted: Sep 14 2009, 21:20
by kuke666
其他前面加个\w ?
这个是什么意思呢?

加在哪?MATCHE里??

Re: 广告过滤求教!

Posted: Sep 14 2009, 21:28
by cre
我是说的这个。。。

这是可以的。

Code: Select all

[Patterns]
Name = "baidu"
Active = TRUE
URL = "www.baidu.com"
Limit = 256
Match = "\1高级"
Replace = "\1低级"
这是不行的。

Code: Select all

[Patterns]
Name = "baidu"
Active = TRUE
Limit = 256
Match = "$URL(www.baidu.com)\1高级"
Replace = "\1低级"
[/color]

这样就行了。

Code: Select all

[Patterns]
Name = "baidu"
Active = TRUE
Limit = 256
Match = "$URL(\wbaidu.com)\1高级"
Replace = "\1低级"

Re: 广告过滤求教!

Posted: Sep 14 2009, 21:36
by kuke666
哦,原来如此~~

Re: 广告过滤求教!

Posted: Sep 14 2009, 21:46
by 不夜侯

Code: Select all

[Patterns]
Name = "Kill ad table"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "<table\s*</table>"
Limit = 3500
Match = "*此广告位招租*"
Replace = "<!---- 广告 ---->"


Re: 广告过滤求教!

Posted: Sep 15 2009, 09:49
by phoenix
why wrote: 这样就行了。

Code: Select all

[Patterns]
Name = "baidu"
Active = TRUE
Limit = 256
Match = "$URL(\wbaidu.com)\1高级"
Replace = "\1低级"
这里有个问题,\wbaidu.com 会匹配 iambaidu.com 或 http://www.google.com/baidu.com 这样的 URL。

$URL() 只是要求你把协议部分写上,不如写成 $URL(http://www.baidu.com/)。