money-money/api.go

29 lines
579 B
Go
Raw Permalink Normal View History

2022-06-23 09:06:00 +00:00
package moneymoney
import (
"github.com/474420502/gcurl"
)
func GetFromAPI() {
tp := gcurl.Parse(`curl 'http://quotes.money.163.com/service/chddata.html?code=0601398&start=20140720&end=20150508'`).Temporary()
pcode := tp.QueryParam("code")
start := tp.QueryParam("start")
end := tp.QueryParam("end")
for _, code := range GetStocks() {
2022-07-03 00:38:06 +00:00
if code.MCAP >= 100*100000000 {
2022-06-23 09:06:00 +00:00
pcode.StringSet(code.CODE)
2022-06-23 14:59:47 +00:00
start.StringSet("20150101")
2022-07-03 00:38:06 +00:00
end.StringSet("20220701")
2022-06-23 09:06:00 +00:00
resp, err := tp.Execute()
if err != nil {
panic(err)
}
SaveFromCSV(resp.Content())
}
}
}