コード例 #1
0
ファイル: quandl_test.go プロジェクト: illyabusigin/quandl
func ExampleGetList() {
	// This block is optional
	quandl.ApiKey = apiKey
	quandl.CacheHandler = filecache.Handler{Life: 60}
	// ---

	data, err := quandl.GetList("WIKI", 1, 3)
	if err != nil {
		panic(err)
	}

	for i, doc := range data.Docs {
		fmt.Println(i, doc.Code)
		break
	}

	// Output:
	// 0 AAPL
}
コード例 #2
0
ファイル: quandl_test.go プロジェクト: illyabusigin/quandl
func ExampleListResponse() {
	// This block is optional
	quandl.ApiKey = apiKey
	quandl.CacheHandler = filecache.Handler{Life: 60}
	// ---

	data, err := quandl.GetList("WIKI", 2, 5)
	if err != nil {
		panic(err)
	}

	if data.TotalCount > 3000 {
		fmt.Println("Found over 3000 results")
	}
	fmt.Println(data.CurrentPage)
	fmt.Println(data.PerPage)
	// fmt.Println(data.Docs[0].Code)

	// Output:
	// Found over 3000 results
	// 2
	// 5
}