nikopol/botaniko — pull request #5 by bfontaine (2013-08-23 15:43:08+00:00)
Title: Gilbert plugin added.

This plugin add a `bab` command, which one can use to display the latest babyfoot games (but it can’t be used for other games, too). You’ll have to set the host of your games’ API, line 18.

### Basic Usage

`bab` display the last five games. You can change its behavior with the `limit` parameter (default: `limit=5`), and the `format` one (default: `format=classic`). There are currently two formats available, `classic` and `short`.

### Filtering

The command support a basic filter DSL, to filter games based on the name of the players. In the examples below, `` is a valid regular expression, without `&` nor `/`. Spaces between delimiters and regexes are not important.

`bab & / & ` search for games where a player whose name matches `` teamed with a player whose name matches `` against a team with a player whose name matches `` and another whose name matches ``. The order of the teams and the order of the players inside each team is not important.

For example, you can match all games using `bab .* & .* / .* & .*`. Some shortcuts are available:

- `bab `: search for games with a match on one player. This is equivalent to ` & .* / .* & .*`.
- `bab / `: search for games with matches on two players of different teams. This is equivalent to ` & .* / & .*`.
- `bab & `: same as above, but for players of the same team.

#### Examples

- `bab nico/niko`: games where Nico played against Niko
- `bab nico & hugo / niko & .* format=short`: games where Nico played with Hugo against Niko
- `bab nico/nico`: games where Nico played against himself (this can be used to find problems in games)

### Limitations

- accents don’t work in regexes (e.g. `stéph`)
- we can’t submit new games results (this is due to the fact that I couldn’t test the API on this).
- filters don’t work on dates and scores
- we can’t display the score of an user (the API doesn’t return it, we would have to compute it by ourselves)