Skip to contents

Competitions of a competition type from liguemagnus.com (get_competition_by_type): one row per season, with the competition_id the other routes key a season by. Coverage starts in 2020-21.

Usage

magnus_competitions(competition_type = 1, return_parsed = TRUE)

Arguments

competition_type

Competition type: 1 = Ligue Magnus (default), 2 = Division 1.

return_parsed

Parse the payload into a tibble (default TRUE). Pass FALSE for the raw JSON envelope as a list.

Value

A tibble (return_parsed = TRUE), else the raw envelope list:

col_nametypedescription
competition_idintegerLigue Magnus competition id (integer); one per season, the key get_phases and get_rencontres take (1 = 2020-21 ... 240 = 2026-27).
seasonintegerSeason by its END year (2027 = 2026-27), the federation's saison field.
competitioncharacterCompetition name as published (sponsor name included, e.g., "Synerglace Ligue Magnus").
competition_type_idintegerCompetition type id: 1 = Ligue Magnus, 2 = Division 1.
competition_type_codecharacterCompetition type code (NA for the Ligue Magnus).
competition_typecharacterCompetition type label (e.g., "Ligue Magnus").
external_urlcharacterExternal site linked from the competition (streaming partner).
publishedlogicalWhether the competition is published on the league site.

Errors

fastRhockey_no_data: success = false with "Aucune donnee disponible", an empty data stub, zero rows, a season outside 2020-21 onwards, an unknown or unplayed game. fastRhockey_asset_fetch: a failed fetch, success = false with any other message, rows outside the requested scope, a partial schedule page, or a game page without its embedded game sheet. fastRhockey_bad_request: HTTP 400/422, a validation error naming a rejected parameter, or an invalid argument.

Examples

# \donttest{
  try(magnus_competitions())
#> Error in .euro_check_status(resp) : 
#>   liguemagnus.com/wp-admin/admin-ajax.php answered HTTP 403:
#> <html><body><h1>403 Forbidden</h1> Request forbidden by administrative rules.
#> Interdiction d'acceder a cette ressource </body></html>
# }