Home

Awesome

QQWry

纯真IP库 golang 版

有关纯真IP库的文档详见 http://lumaqq.linuxsir.org/article/qqwry_format_detail.html

1. 依赖

go get code.google.com/p/mahonia

update:

go get github.com/yinheli/mahonia

下载地址 http://update.cz88.net/soft/qqwry.rar

2. 使用

go get github.com/yinheli/qqwry
import (
	"github.com/yinheli/qqwry"
	"log"
)

func main() {
	q := qqwry.NewQQwry("qqwry.dat")
	q.Find("180.89.94.90")
	log.Printf("ip:%v, Country:%v, City:%v", q.Ip, q.Country, q.City)
	// output: 
	// 2014/02/22 22:10:32 ip:180.89.94.90, Country:北京市, City:长城宽带
}

3. 使用注意

4. license

Licensed under MIT.