adblock:用于Adblock Plus过滤器的Golang解析器
AdBlock
adblock是用于使用Adblock Plus过滤规则的软件包。 它可以解析Adblock Plus过滤器,并根据它们匹配URL。
安装
$ go get -u github.com/bluele/adblock
例子
package main
import (
"fmt"
"github.com/bluele/adblock"
)
func main () {
ab , err := adblock . NewRules ([] string {
"||google.com/ads/$domain=black.example.com" ,
"||example.com/" ,
"@@||example.com/white/" ,
}, nil )
if err != nil {
panic ( err )
}