diff --git a/api.go b/api.go index ee05756..7e11cca 100644 --- a/api.go +++ b/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() diff --git a/main.go b/main.go index ddcf2ad..a91d57b 100644 --- a/main.go +++ b/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) diff --git a/stock_codes.gob b/stock_codes.gob index 3462249..0a96178 100644 Binary files a/stock_codes.gob and b/stock_codes.gob differ