A command-line utility written in Perl that retrieves Major League Baseball game information from the MLB Stats API and displays:
- Daily game matchups with probable pitchers
- Division standings
- Displays today's MLB matchups
- Converts game times to Eastern time zone
- Shows probable pitchers and records
- Displays division standings
- Uses the official MLB Stats API
- No API key required
- Perl 5
- HTTP::Tiny
- JSON::PP
- DateTime
- DateTime::Format::ISO8601
- Text::Unidecode
- Getopt::Long
Install required packages:
sudo pkg install p5-DateTime p5-DateTime-Format-ISO8601 p5-Text-UnidecodeClone the repository:
git clone https://github.com/asuttles/mlb.git
cd mlbMake the script executable:
chmod +x mlb.plDisplay today's matchups:
./mlb.pl --matchupsDisplay division standings:
./mlb.pl --standingsDisplay help:
./mlb.plThere are 9 MLB games today:
Cleveland Guardians (40-35) 4 [FINAL]
Milwaukee Brewers (45-27) 2
> Parker Messick 7-3 (2.70)
> Shane Drohan 3-2 (3.40)
New York Mets (33-41) 3 [LIVE]
Philadelphia Phillies (40-34) 2
> Sean Manaea 1-2 (4.67)
> Aaron Nola 3-4 (5.79)
Los Angeles Angels (30-45) [09:40 PM]
Athletics (36-38)
> Ryan Johnson 0-1 (15.12)
> Gage Jump 2-1 (3.09)
American League East
---------------------------------------
Team GP Win Loss Pct GB Strk
Yankees 72 45 27 .625 - W4
Rays 71 41 30 .577 3.5 L3
Blue Jays 75 37 38 .493 9.5 W3
Orioles 76 35 41 .461 12.0 L1
Red Sox 72 29 43 .403 16.0 L4
American League Central
---------------------------------------
Team GP Win Loss Pct GB Strk
Guardians 75 40 35 .533 - W1
White Sox 72 38 34 .528 0.5 L2
Twins 76 36 40 .474 4.5 W4
Tigers 74 30 44 .405 9.5 L2
Royals 75 30 45 .400 10.0 W1
This project is licensed under the BSD 2-Clause License. See the LICENSE file for details.