sidki config set的配置、使用,新手入门首选
Moderator: phoenix
ddbb
Moderator
Posts: 425 Joined: Jan 07 2008, 13:30
Post
by ddbb » Jul 23 2008, 14:31
刚才研究sidki加JS
看到了IncludeExclude-U.ptxt里 有这么一段.....
## insert user script $SET(sUserJS=JS_CODE)
##
## JS_CODE can be any valid JS code, like:
## var foo = "bar", check = true; function test() {}
## ----------------------------------------------------------------------------
看上去应该是自己加JS用的......
可是我试了一下 怎么都试不出来
我试过了
Code: Select all
www.google.com var foo = "bar", check = true; function test() {} $SET(sUserJS=JS_CODE)
var foo = "bar", check = true; function test() {} $SET(sUserJS=JS_CODE)
www.google.com var foo = "bar", check = true; function test() {}
去网页里直接看src......都没找到 var foo = "bar", check = true; function test()
是我理解错了么???
phoenix
Site Admin
Posts: 529 Joined: Dec 29 2007, 16:27
Post
by phoenix » Jul 23 2008, 14:36
试试:
Code: Select all
www.google.com/ $SET(sUserJS=var foo = "bar", check = true; function test() {})
ddbb
Moderator
Posts: 425 Joined: Jan 07 2008, 13:30
Post
by ddbb » Jul 23 2008, 14:39
这么快.........
好用了.........原来是这样..........
为什么我就没想到...........-_-
ddbb
Moderator
Posts: 425 Joined: Jan 07 2008, 13:30
Post
by ddbb » Jul 23 2008, 14:52
顺便说一下......
发现了sidki的一个小BUG
我在IncludeExclude-U.ptxt里加了一句 用来显示baidu贴吧的发言框
Code: Select all
tieba.baidu.com $SET(0=a_adcont_i.)
然后又加了一个
Code: Select all
tieba.baidu.com $SET(sUserJS=var foo = "bar", check = true; function test() {})
JS能正常出来 但是第一句那个a_adcont_i就没有效果了.....发言框被过滤掉
把JS那句删掉 发言框就出来了
phoenix
Site Admin
Posts: 529 Joined: Dec 29 2007, 16:27
Post
by phoenix » Jul 23 2008, 15:08
不是bug。Proxomitron在扫描blockfile的时候,遇到第一个匹配项后即停止扫描了。IncludeExclude-U.ptxt文件开头的注释中也有解释,你看下。
另外,在URL后面加“/”会是个好习惯,详情参考
帮助文件 中的
Blocklist Indexing (hashes) 部分。
所以,正确的写法应该是:
Code: Select all
tieba.baidu.com/ $SET(0=a_adcont_i.) $SET(sUserJS=var foo = "bar", check = true; function test() {})
ddbb
Moderator
Posts: 425 Joined: Jan 07 2008, 13:30
Post
by ddbb » Jul 23 2008, 15:45
差不多明白了........
现在终于两个效果都有了.......
麻烦你了.....
red
Posts: 99 Joined: Mar 09 2010, 16:25
Post
by red » Mar 13 2010, 21:41
抱歉,不想新开一贴。看到ph提及Blocklist Indexing (hashes),当初看help的时候就有不明白
URL style hashes...It works by looking in the expression for the end of the hostname (marked by a ":" or "/") and indexes back from there. For it to work there must be no other wildcards between the hostname's end and the leading wildcard. Valid wildcards include "*", "\w", "[...]+", "[...]++", and "(...|)".
help里给出几个例子,其余的蛮好懂,这2个不太明白
*somehost.com/(anything|after|here|is|fine)/\w.html
(http://www.|)somehost.com:[0-9]+/
1、URL style hashes难道不是都以":" 或者"/"结尾的吗,比如上面的第1个例子
2、第2个例子开头与结尾不是还有个[0-9]+,[0-9]不算wildcard?
Bonnie
Moderator
Posts: 165 Joined: Oct 05 2008, 01:27
Post
by Bonnie » Mar 14 2010, 01:18
应该是只要一部分符合就会索引全部
比如第一个例子的*somehost.com/满足索引要求,第二个的(http://www.|)somehost.com:满足索引要求,
另外就是要足够长,两种索引好像都必须要超过10个可索引字符才会被索引。
red
Posts: 99 Joined: Mar 09 2010, 16:25
Post
by red » Mar 14 2010, 09:21
"fixed prefix"在help中是有如下说明
The longer the prefix is before any wildcard, the more indexable it becomes.
看来"URL style hashes" 与"fixed prefix" 一样,只是没有写明
多谢讲解