Skip to content

A small cli tool to get the latest football scores, fixtures and standings

License

Notifications You must be signed in to change notification settings

fritzrehde/footy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

footy

A simple shell script that displays the latest football scores, fixtures and standings.

asciicast

Table of Contents

Features

  • Minimalistic output: aiming to adhere to the Unix philosophy, footy's output can easily be piped to other tools
  • Portable: minimal dependencies

Install

Since footy uses the data provided by football-data.org, an api-key is required. You can register for one here for free.

Once footy is installed, set the api-key by running footy -k <api-key> or manually create the file $HOME/.config/footy/api-key.txt containing only the api-key.

Build from source

git clone https://github.com/fritzrehde/footy.git
cd footy
sudo make install

Note: The makefile defaults to some default paths for installed files. Adjust to your system:

  • INSTALL_DIR: PATH for executables (default /usr/local/bin)
make install INSTALL_DIR=/usr/bin

Usage

OPTIONS:
  -s                Prints standings/table
                    Must be used with -c <COMPETITION>
  -m <DAYS+/->      Prints upcoming ('+' suffix) or previous ('-' suffix) matches
                    Must be used with either -c <COMPETITION> or -t <TEAM>
  -c <COMPETITION>  Specifies competition (use code or id)
  -t <TEAM>         Specifies team (must use team's id)
  -I                Prints all supported competitions
  -i <COMPETITION>  Prints all teams in competition (use code or id)
  -r                Unformatted output for piping to other tools
  -k <API-KEY>      Saves the api-key to $HOME/.config/footy/api-key.txt
  -h                Prints this help message

Supported competitions and teams

footy -I gives you an overview of all the supported competitions (I recommend piping the output into a pager).

footy -i BL1 or footy -i 2002 prints all teams in the Bundesliga using either the Code BL1 or the Id 2002.

Some competitions do not have a Code and teams never have a Code, so you will have to use the Id there.

Note: Access to some of the smaller competitions/teams is paid (pricing). Therefore, the Price column shows which competitions are free.

Piping output to other tools

The -r option provides unformatted output, where the columns are seperated by commas instead of whitespaces and the match dates are in the ISO-8601 UTC format.

Example

footy -s -c BL1 -r | cut -d ',' -f 1-6,10 | column -ts ','

This command will only display the first six and the tenth column of the standings output.

Dependencies

  • jq: JSON processor

License

The MIT License © Fritz Rehde

About

A small cli tool to get the latest football scores, fixtures and standings

Topics

Resources

License

Stars

Watchers

Forks