nflscores

package module
v0.0.0-...-a8fd42d Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: MIT Imports: 6 Imported by: 1

README

NFLSCORES

This is a simple command-line utility which scrapes all of the NFL scores and dumps them to the terminal in CSV format. This utility was written over a weekend for a friend, and will likely not see active development again unless somebody opens an issue.

Installing

go get git.sr.ht/~ocelotsloth/nflscores/nflscores should get you where you need to go.

You will need to install golang first, of course. At this time I will not be distributing precompiled binaries.

Usage

Simply type nflscores after installing the binary. To bring up the help message.

Architecture

Note that the library I defined is in the git.sr.ht/~ocelotsloth/nflscores package, while the actual executable command is defined in the git.sr.ht/~ocelotsloth/nflscores/nflscores package. You need to install the executable to work with this tool. Look in that directory for the main.go file if you are looking to read how this tool functions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGameHeaders

func GetGameHeaders() []string

GetGameHeaders returns a row of string headers

func ScrapeWeeks

func ScrapeWeeks(year string) ([]string, []string)

ScrapeWeeks returns a map of week IDs to human names for a given year.

func ScrapeYears

func ScrapeYears() []string

ScrapeYears returns a list of all Football seasons available.

func WriteCSV

func WriteCSV(output io.Writer)

WriteCSV scrapes games and writes to given io.Writer

func WriteFile

func WriteFile(fileName string)

WriteFile writes to a given filename

Types

type Game

type Game struct {
	// contains filtered or unexported fields
}

Game stores all the information about a game.

func ScrapeGames

func ScrapeGames(year string, weekID string, weekName string) []Game

ScrapeGames returns an array of all games from a given week.

func (Game) ToRow

func (g Game) ToRow() []string

ToRow returns input as row of strings

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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