ZeroBot-Plugin/plugin_vtb_quotation/utils/utils.go
himawari e812d2a074
添加vtb语音包 (#74)
* fix:给msg进行url编码,解决青云客接口返回错误

* feat:增加一个vtbkeyboard.moe接口

* fix:id添加映射

* feat:优化逻辑

* feat:优化逻辑

* feat:优化逻辑

* feat:优化逻辑

* feat:增加一个随机vtb

* feat:增加一个随机vtb

* refactor:更改代码逻辑

* feat:更新数据库

* feat:更新数据库

* feat:更新数据库

* feat:更新数据库

* feat:更新数据库驱动

* feat:增加定时更新数据脚本

* feat:更换驱动

* fix:更新zerobot

* fix:修改全局变量

* fix:微调位置

* fix:解决modernc.org/sqlite版本冲突

* fix:解决go.sum冲突,更换cron库
2021-11-20 13:34:37 +08:00

25 lines
986 B
Go

package utils
import (
"math/rand"
"time"
)
var agent = [...]string{
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0",
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11",
"Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)",
"Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)",
"User-Agent,Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50",
"User-Agent, Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)",
"User-Agent,Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50",
}
func GetAgent() string {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
len1 := len(agent)
return agent[r.Intn(len1)]
}