downloader

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package downloader manages grabbing CSV from Concept2 website You need to have an account at https://log.concept2.com. This downloads the season CSV files from the https://log.concept2.com/history page.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

type Downloader struct {
	// Username Concept 2 username
	Username string
	// Password Concept 2 password
	Password string
	// Path The location where data files will be saved to
	Path string
	// contains filtered or unexported fields
}

Downloader manages the download options Simply grab a downloader and either call GetSeasons or GetAllSeasons

path, _ := filepath.Abs("./data")
dl := downloader.NewDownloader("myuser", "mypassword", path)
dl.SetHeadless(false)
dl.GetSeasons([]string{"2021"})

func NewDownloader added in v0.2.0

func NewDownloader(username string, password string, path string) Downloader

NewDownloader generates a new downloader with default options The username and password are for https://log.concept2.com The path is the path which you wish the data files to be downloaded to

func (Downloader) GetAllSeasons added in v0.2.0

func (dl Downloader) GetAllSeasons()

GetAllSeasons downloads all of the available seasons from the history page https://log.concept2.com/history

func (Downloader) GetSeasons

func (dl Downloader) GetSeasons(seasons []string)

GetSeasons downloads the seasons CSV data from Concept2 site into the Downloader struct's path for the specified seasons Use the final year of the season so for season 2020/21, use 2021

func (*Downloader) SetHeadless added in v0.2.0

func (dl *Downloader) SetHeadless(headless bool)

SetHeadless sets whether the browser should be headless or not By default it's headless but if you want to see the browser do its thing, you can set this to true and browser will show during operations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL