Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

MLB Matchups

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

Features

  • 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

Requirements

  • Perl 5
  • HTTP::Tiny
  • JSON::PP
  • DateTime
  • DateTime::Format::ISO8601
  • Text::Unidecode
  • Getopt::Long

FreeBSD

Install required packages:

sudo pkg install p5-DateTime p5-DateTime-Format-ISO8601 p5-Text-Unidecode

Installation

Clone the repository:

git clone https://github.com/asuttles/mlb.git
cd mlb

Make the script executable:

chmod +x mlb.pl

Usage

Display today's matchups:

./mlb.pl --matchups

Display division standings:

./mlb.pl --standings

Display help:

./mlb.pl

Example Output

Matchups

There 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)

Standings

        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

License

This project is licensed under the BSD 2-Clause License. See the LICENSE file for details.

About

A command-line utility that retrieves MLB data from the MLB Stats API and displays today's game matchups and division standings.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages