Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ icbcGold Public

工商银行获取黄金价格, 发送通知, 黄金价格预警提醒

Notifications You must be signed in to change notification settings

llych/icbcGold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

7 Commits

Repository files navigation

获取工商银行黄金价格, 升降(幅度0.5)发送通知

使用

git clone https://github.com/llych/icbcGold.git
cd icbcGold
go get -v .
go run icbc.go
$ go run icbc.go
2019年02月07日T13:44:24+08:00 INF icbc.go:69 > 当前价格: 282.56
2019年02月07日T13:44:24+08:00 INF icbc.go:85 > 当前价格: 282.56 [上升]
2019年02月07日T13:44:26+08:00 INF icbc.go:104 > 发送成功
2019年02月07日T13:45:24+08:00 INF icbc.go:69 > 当前价格: 282.57
2019年02月07日T13:46:23+08:00 INF icbc.go:69 > 当前价格: 282.56
2019年02月07日T13:47:23+08:00 INF icbc.go:69 > 当前价格: 282.56

通知地址

http://api.xx.com/weixin , 自行斟酌修改

func wechat(msg string) {
	var (
		res *http.Response
		err error
	)
	if res, err = http.PostForm("http://api.xx.com/weixin", url.Values{"msg": {msg}}); err != nil {
		log.Error().Msg("发送失败")
	} else {
		log.Info().Msgf("发送成功")
	}
	res.Body.Close()
}

About

工商银行获取黄金价格, 发送通知, 黄金价格预警提醒

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /