稳定版本
This commit is contained in:
parent
58c19218bf
commit
04fec33a01
4
api.go
4
api.go
|
@ -12,9 +12,9 @@ func GetFromAPI() {
|
|||
|
||||
for _, code := range GetStocks() {
|
||||
|
||||
if code.MCAP >= 20000000000 {
|
||||
if code.MCAP >= 200*100000000 {
|
||||
pcode.StringSet(code.CODE)
|
||||
start.StringSet("20170101")
|
||||
start.StringSet("20150101")
|
||||
end.StringSet("20220622")
|
||||
|
||||
resp, err := tp.Execute()
|
||||
|
|
5
main.go
5
main.go
|
@ -123,7 +123,7 @@ var err error
|
|||
func init() {
|
||||
log.SetFlags(log.Llongfile | log.LstdFlags)
|
||||
|
||||
client, err = mongo.Connect(context.TODO(), options.Client().ApplyURI("mongodb://root:6601502@localhost:27017"))
|
||||
client, err = mongo.Connect(context.TODO(), options.Client().ApplyURI("mongodb://localhost:27017"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ func GetStocks() []*StockBase {
|
|||
}
|
||||
} else {
|
||||
|
||||
murl := `curl 'http://quotes.money.163.com/hs/service/diyrank.php?count=5000'`
|
||||
murl := `curl 'http://quotes.money.163.com/hs/service/diyrank.php?page=0&query=STYPE%3AEQA&fields=NO%2CSYMBOL%2CNAME%2CPRICE%2CPERCENT%2CUPDOWN%2CFIVE_MINUTE%2COPEN%2CYESTCLOSE%2CHIGH%2CLOW%2CVOLUME%2CTURNOVER%2CHS%2CLB%2CWB%2CZF%2CPE%2CMCAP%2CTCAP%2CMFSUM%2CMFRATIO.MFRATIO2%2CMFRATIO.MFRATIO10%2CSNAME%2CCODE%2CANNOUNMT%2CUVSNEWS&sort=PERCENT&order=asc&count=6000&type=query'`
|
||||
tp := gcurl.Parse(murl).Temporary()
|
||||
resp, err := tp.Execute()
|
||||
if err != nil {
|
||||
|
@ -181,6 +181,7 @@ func GetStocks() []*StockBase {
|
|||
}
|
||||
jr := gjson.ParseBytes(resp.Content())
|
||||
|
||||
log.Println(len(jr.Get("list").Array()))
|
||||
for _, s := range jr.Get("list").Array() {
|
||||
var stockCode StockBase
|
||||
err = json.Unmarshal([]byte(s.String()), &stockCode)
|
||||
|
|
BIN
stock_codes.gob
BIN
stock_codes.gob
Binary file not shown.
Loading…
Reference in New Issue
Block a user