模拟wap飞信登陆,无需输入验证码,适合用作定期发送短信、命令行操作等。
如果有某次登陆密码输入错误,直接登录会需要输入验证码。可以在网页上手动登录一遍,之后再使用本库登陆就不需要输入验证码了。
go get -u github.com/fanan/fetion_golang
package main
import (
"fmt"
"github.com/fanan/fetion_golang"
)
func main() {
mobileNumber := "13888888888"
password := "88888888"
f := fetion.NewFetion(mobileNumber, password)
err := f.Login()
if err != nil {
fmt.Println(err)
return
}
defer f.Logout()
f.BuildUserDb()
users := []string{"12345678901", "98765432109"}
msg := "Hello 世界"
f.SendSms(msg, users)
f.SendOneself("发送成功")
}