/footy

A small command line tool to get the latest football scores, fixtures and standings.

Primary LanguageShellMIT LicenseMIT

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 -l <LEAGUE>
  -m <+/-DAYS>  Prints upcoming ('+' prefix) or previous ('-' prefix) matches 
                Must be used with either -l <LEAGUE> or -t <TEAM>
  -l <LEAGUE>   Specifies league (use league's code or id)
  -t <TEAM>     Specifies team (must use team's id)
  -I            Prints all supported leagues
  -i <LEAGUE>   Prints all teams in league (use league's 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 leagues and teams

footy -I gives you an overview of all the supported leagues (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 leagues 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 leagues/teams is paid (pricing). Therefore, the Price column shows which leagues 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 -l 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