update name
This commit is contained in:
parent
ed40d95b74
commit
fa54e7b2ec
34
README.md
34
README.md
|
@ -1,49 +1,49 @@
|
||||||
# mlblive
|
# mlbstats
|
||||||
mlblive is a CLI tool for retrieving data from Major League Baseball's Stats
|
mlbstats is a CLI tool for retrieving data from Major League Baseball's Stats
|
||||||
API, including efficient retrieval of live game data. Unofficial documentation
|
API, including efficient retrieval of live game data. Unofficial documentation
|
||||||
on the Stats API can be found
|
on the Stats API can be found
|
||||||
[here](https://github.com/toddrob99/MLB-StatsAPI/wiki/Endpoints) (thanks to
|
[here](https://github.com/toddrob99/MLB-StatsAPI/wiki/Endpoints) (thanks to
|
||||||
GitHub user toddrob99 for this resource).
|
GitHub user toddrob99 for this resource).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
mlblive provides sub-commands to query a subset of the Stats API endpoints. As
|
mlbstats provides sub-commands to query a subset of the Stats API endpoints. As
|
||||||
of the time of writing, the sub-commands are:
|
of the time of writing, the sub-commands are:
|
||||||
* `mlblive content` (accesses the `game_content` endpoint)
|
* `mlbstats content` (accesses the `game_content` endpoint)
|
||||||
* `mlblive feed` (accesses the `game` endpoint)
|
* `mlbstats feed` (accesses the `game` endpoint)
|
||||||
* `mlblive schedule` (accesses the `schedule` endpoint)
|
* `mlbstats schedule` (accesses the `schedule` endpoint)
|
||||||
* `mlblive standings` (accesses the `standings` endpoint)
|
* `mlbstats standings` (accesses the `standings` endpoint)
|
||||||
* `mlblive subscribe` (accesses the game WebSocket endpoint)
|
* `mlbstats subscribe` (accesses the game WebSocket endpoint)
|
||||||
|
|
||||||
Each sub-command outputs the raw JSON response from the API. This can then be
|
Each sub-command outputs the raw JSON response from the API. This can then be
|
||||||
piped into other commands like `jq` for further processing. See [this
|
piped into other commands like `jq` for further processing. See [this
|
||||||
repo](https://scm.dairydemon.net/filifa/mlblive-mastodon-scripts) for examples
|
repo](https://scm.dairydemon.net/filifa/mlbstats-mastodon-scripts) for examples
|
||||||
of how the author use this program for posting live score updates and
|
of how the author uses this program for posting live score updates and
|
||||||
highlights to Mastodon.
|
highlights to Mastodon.
|
||||||
|
|
||||||
Note that mlblive does not provide sub-commands for every endpoint, or flags
|
Note that mlbstats does not provide sub-commands for every endpoint, or flags
|
||||||
for every parameter of every endpoint. The functionality provided was
|
for every parameter of every endpoint. The functionality provided was
|
||||||
prioritized based on the author's own needs. However, the author has made every
|
prioritized based on the author's own needs. However, the author has made every
|
||||||
effort to make the current functionality's code easy to read, and hopes it will
|
effort to make the current functionality's code easy to read, and hopes it will
|
||||||
be similarly easy for other developers to extend functionality as needed.
|
be similarly easy for other developers to extend functionality as needed.
|
||||||
|
|
||||||
### subscribe sub-command
|
### subscribe sub-command
|
||||||
`mlblive subscribe` provides an efficient way to obtain live data on active MLB
|
`mlbstats subscribe` provides an efficient way to obtain live data on active MLB
|
||||||
games. Supply the game's PK (which can be retrieved with `mlblive schedule`) to
|
games. Supply the game's PK (which can be retrieved with `mlbstats schedule`) to
|
||||||
receive updates as they happen, without needing to blindly query the `game`
|
receive updates as they happen, without needing to blindly query the `game`
|
||||||
endpoint.
|
endpoint.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
Use `mlblive schedule` to get the game PK(s) for today's Reds game:
|
Use `mlbstats schedule` to get the game PK(s) for today's Reds game:
|
||||||
```
|
```
|
||||||
mlblive schedule -t cin
|
mlbstats schedule -t cin
|
||||||
```
|
```
|
||||||
Optionally, use `jq` to filter this output to *just* the game PK(s):
|
Optionally, use `jq` to filter this output to *just* the game PK(s):
|
||||||
```
|
```
|
||||||
mlblive schedule -t cin | jq '.dates[].games[].gamePk'
|
mlbstats schedule -t cin | jq '.dates[].games[].gamePk'
|
||||||
```
|
```
|
||||||
Then, pass a PK to get live updates:
|
Then, pass a PK to get live updates:
|
||||||
```
|
```
|
||||||
mlblive subscribe -g <gamePk>
|
mlbstats subscribe -g <gamePk>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
|
@ -23,7 +23,7 @@ import (
|
||||||
|
|
||||||
// rootCmd represents the base command when called without any subcommands
|
// rootCmd represents the base command when called without any subcommands
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "mlblive",
|
Use: "mlbstats",
|
||||||
Short: "Command line tools for Major League Baseball's Stats API",
|
Short: "Command line tools for Major League Baseball's Stats API",
|
||||||
Long: `Command line tools for Major League Baseball's Stats API.`,
|
Long: `Command line tools for Major League Baseball's Stats API.`,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue