move
This commit is contained in:
parent
053c99c9ea
commit
b6cc36a4dd
8
main.go
8
main.go
@ -16,8 +16,8 @@ const (
|
|||||||
// ----------以下内容可按需更改,且均为必填项----------
|
// ----------以下内容可按需更改,且均为必填项----------
|
||||||
aliCloudAccessKeyId = "LTAI5tF989AsPXTEBgoDNE4W" // 通过 https://ram.console.aliyun.com/manage/ak 获取
|
aliCloudAccessKeyId = "LTAI5tF989AsPXTEBgoDNE4W" // 通过 https://ram.console.aliyun.com/manage/ak 获取
|
||||||
aliCloudAccessKeySecret = "eS9U6x3klXjrh5cDgT1bZrhjOppOat" // 通过 https://ram.console.aliyun.com/manage/ak 获取
|
aliCloudAccessKeySecret = "eS9U6x3klXjrh5cDgT1bZrhjOppOat" // 通过 https://ram.console.aliyun.com/manage/ak 获取
|
||||||
domainURL = "kkgggkgkgkg.online" // 你的域名 比如 laghaim.cn
|
domainURL = "tixly.top" // 你的域名 比如 laghaim.cn
|
||||||
rr = "ssh" // 主机记录 如果要解析@.exmaple.com,主机记录要填写”@”,而不是空。如果要解析www,就填写www即可
|
rr = "www" // 主机记录 如果要解析@.exmaple.com,主机记录要填写”@”,而不是空。如果要解析www,就填写www即可
|
||||||
//主机记录就是域名前缀,常见用法有:
|
//主机记录就是域名前缀,常见用法有:
|
||||||
//www:解析后的域名为www.aliyun.com。1
|
//www:解析后的域名为www.aliyun.com。1
|
||||||
//@:直接解析主域名 aliyun.com。
|
//@:直接解析主域名 aliyun.com。
|
||||||
@ -145,7 +145,7 @@ func addDomainFirst(client *alidns20150109.Client, realIp *string) error {
|
|||||||
|
|
||||||
// getIpHost 通过访问网站的方式获取ip地址
|
// getIpHost 通过访问网站的方式获取ip地址
|
||||||
func getIpHost() *string {
|
func getIpHost() *string {
|
||||||
resp, err := http.Get("https://www.taobao.com/help/getip.php") // 这是PHP写的功能,语言是工具,不是你炫耀的资本,更没有鄙视链一说,只有适合与不适合
|
resp, err := http.Get("http://ip-api.com/json/?lang=zh-CN") // 这是PHP写的功能,语言是工具,不是你炫耀的资本,更没有鄙视链一说,只有适合与不适合
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("ip地址查询时出错,error : ", err)
|
log.Println("ip地址查询时出错,error : ", err)
|
||||||
return nil
|
return nil
|
||||||
@ -157,7 +157,7 @@ func getIpHost() *string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
str := string(allByte)
|
str := string(allByte)
|
||||||
re := regexp.MustCompile(`ip:"(.*)"`)
|
re := regexp.MustCompile(`"query"\s*:\s*"(.*?)"`)
|
||||||
match := re.FindStringSubmatch(str)
|
match := re.FindStringSubmatch(str)
|
||||||
if len(match) != 0 {
|
if len(match) != 0 {
|
||||||
return &match[1]
|
return &match[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user