From 6a8e39a431ce75702501daed53b59b7af783892c Mon Sep 17 00:00:00 2001 From: filifa Date: Sun, 28 Jul 2024 14:10:40 -0500 Subject: [PATCH] add readme --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9a84264 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# mlblive +mlblive is a CLI tool for retrieving data from Major League Baseball's Stats +API, including efficient retrieval of live game data. Unofficial documentation +on the Stats API can be found +[here](https://github.com/toddrob99/MLB-StatsAPI/wiki/Endpoints) (thanks to +GitHub user toddrob99 for this resource). + +## Usage +mlblive provides sub-commands to query a subset of the Stats API endpoints. As +of the time of writing, the sub-commands are: +* `mlblive content` (accesses the `/content` endpoint) +* `mlblive feed` (accesses the `/feed/live` endpoint) +* `mlblive schedule` (accesses the `/schedule` endpoint) +* `mlblive subscribe` (accesses the game WebSocket endpoint) + +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 +repo](https://scm.dairydemon.net/filifa/mlblive-mastodon-scripts) for examples +of how the author use this program for posting live score updates and +highlights to Mastodon. + +Note that mlblive does not provide sub-commands for every endpoint, or flags +for every parameter of every endpoint. The functionality provided was +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 +be similarly easy for other developers to duplicate this code for extending +functionality as needed. + +### subscribe sub-command +`mlblive 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 +receive updates as they happen, without needing to blindly query the +`/feed/live` endpoint. + +## Disclaimer +This program and its author are not affiliated with MLB. Content supplied by +MLB's Stats API is copyright 2024 MLB Advanced Media, L.P., and use of any +content provided by the API acknowledges agreement to the terms posted [here]( +http://gdx.mlb.com/components/copyright.txt).