Quotation from Sina source
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
easyquotation/quotation_test.go

31 lines
611 B

4 years ago
package easyquotation
import (
"easyquotation/sina"
"easyquotation/stock"
"fmt"
"github.com/gocolly/colly"
"testing"
"time"
)
func TestInit(t *testing.T) {
Init()
c := colly.NewCollector()
SinaStock_spider := sina.NewSinaStock(c)
SinaStock_spider.Start("")
4 years ago
tt := time.NewTicker(time.Second * 2)
4 years ago
for {
select {
case <- tt.C:
currentTime := time.Now()
timeFormatted := currentTime.Format("2006-01-02 15:04:05")
fmt.Println("Current time:", timeFormatted)
fmt.Println(stock.G_STOCK_MANAGER.StockList["sz002215"])
fmt.Println(stock.G_STOCK_MANAGER.StockList["sh000001"])
4 years ago
}
}
}