Skip to content

Instantly share code, notes, and snippets.

@tonyelhabr
Created April 30, 2023 17:28
Show Gist options
  • Save tonyelhabr/706f0fbd69e4543a3cdf36fae17fc5e9 to your computer and use it in GitHub Desktop.
Save tonyelhabr/706f0fbd69e4543a3cdf36fae17fc5e9 to your computer and use it in GitHub Desktop.
Get latest opta club rankings from release.
library(readr)
library(dplyr)
opta_club_rankings <- read_csv('https://github.com/tonyelhabr/club-rankings/releases/download/club-rankings/opta-club-rankings.csv')
opta_club_rankings |> 
  filter(updated_at == max(updated_at))
#> # A tibble: 3,000 × 7
#>     rank team              rating `ranking change 7 days` date       updated_at          id                       
#>    <dbl> <chr>              <dbl>                   <dbl> <date>     <dttm>              <chr>                    
#>  1     1 Manchester City    100                         0 2023-04-30 2023-04-30 10:07:17 a3nyxabgsqlnqfkeg41m6tnpp
#>  2     2 Bayern München      97.2                       0 2023-04-30 2023-04-30 10:07:17 apoawtpvac4zqlancmvw4nk4o
#>  3     3 Napoli              95.5                       1 2023-04-30 2023-04-30 10:07:17 gi0l1habji5hpgar77dl5jqe 
#>  4     4 Real Madrid         95                        -1 2023-04-30 2023-04-30 10:07:17 3kq9cckrnlogidldtdie2fkbl
#>  5     5 Liverpool           94                         1 2023-04-30 2023-04-30 10:07:17 c8h9bw1l82s06h77xxrelzhur
#>  6     6 Barcelona           93.9                      -1 2023-04-30 2023-04-30 10:07:17 agh9ifb2mw3ivjusgedj7c3fe
#>  7     7 Arsenal             93.4                       0 2023-04-30 2023-04-30 10:07:17 4dsgumo7d4zupm2ugsvm4zm4d
#>  8     8 PSG                 92.5                       0 2023-04-30 2023-04-30 10:07:17 2b3mar72yy8d6uvat1ka6tn3r
#>  9     9 Manchester United   92.3                       0 2023-04-30 2023-04-30 10:07:17 6eqit8ye8aomdsrrq0hk3v7gh
#> 10    10 Internazionale      92.1                       1 2023-04-30 2023-04-30 10:07:17 3vo5mpj7catp66nrwwqiuhuup
#> # … with 2,990 more rows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment