Skip navigation.

一点笔记

简洁不等于简陋

反查被urlfilter.ini过滤的链接

, , ,

Opera的广告过滤功能一直不怎么完善,用通配符过滤掉的链接基本上不能恢复,这样往往会导致一些链接被误当作广告过滤而无法修正.刚才正巧看到一位朋友在帖子里又提到了这个问题,便用autoit写了一个小工具,用于反查在urlfilter.ini里被过滤掉的链接,这样就可以知道是哪一条过滤规则让链接被视为广告.

下载:
http://files.myopera.com/z8519312/files/op_blocker.zip

使用方法:
先在第一个弹出的对话框内输入urlfilter.ini的路径,然后在第二个对话框内输入要反查的地址,比如说如果是"www.ad.com"被误过滤,就输入"www.ad.com".单击OK后程序会显示出是哪一条过滤规则屏蔽了这一链接,并指出这一链接在urlfilter.ini内的位置.

源码:
#include <File.au3>
Dim $array
Do
$path = InputBox("Op过滤链接反查","请输入urlfilter.ini的路径","C:\Documents and Settings\Administrator\Application Data\Opera\Opera\profile\urlfilter.ini")
If @error=1 Then
$back = MsgBox(4,"","确认退出?")
If $back = 6 Then
Exit
Else
SetError(1)
EndIf
Else
_FileReadToArray ($path , $array )
If @error Then
MsgBox(0,"","文件打开出错")
SetError(1)
EndIf
EndIf
Until Not @error
$string = InputBox("Op过滤链接反查","请输入要反查的链接")
If @error=1 Then
$back = MsgBox(4,"","确认退出?")
If $back = 6 Then
Exit
Else
EndIf
Else
$found =0
For $i = 1 To UBound($array) -1
If StringStripWS ($array[$i],3) = "[exclude]" Then Dim $x = $i
If $array[$i] <>"" And IsDeclared ("x") =1 Then
$var =  stin ( $string, $array[$i] )
If $var =1 Then 
MsgBox(0,"发现一项匹配","文件行号:" & $i &@CRLF&"匹配字符串:"&$array[$i])
$found = 1
EndIf
EndIf
Next
If $found =0 Then
MsgBox(0,"","未发现匹配字符串")
Else
MsgBox(0,"","完成")
EndIf
EndIf

Func stin($var,$2search)
$result =0
$ar = StringSplit($2search,"*")
For $d =1 To $ar[0]
$count = StringInStr($var, $ar[$d] )
If $count <>0 Or $ar[$d] ="" Then
$var = StringTrimLeft ($var, $count )
If $d =$ar[0] Then
$result = 1
ExitLoop
EndIf
Else
ExitLoop
EndIf
Next
Return $result
EndFunc


&#x6211;&#x8981;&#x5566;&#x514D;&#x8D39;&#x7EDF;&#x8BA1;

VeryCD资源更新器V1.3窗口手术师 v1.0

Comments

icyleaf 20. February 2007, 02:47

{wap}感觉这个语言挺怪的…


ps:新年快乐!

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies