money-money/api.go
2022-06-23 22:59:47 +08:00

29 lines
579 B
Go

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() {
if code.MCAP >= 200*100000000 {
pcode.StringSet(code.CODE)
start.StringSet("20150101")
end.StringSet("20220622")
resp, err := tp.Execute()
if err != nil {
panic(err)
}
SaveFromCSV(resp.Content())
}
}
}