-
Notifications
You must be signed in to change notification settings - Fork 14
Instances
David Schoch edited this page Dec 19, 2022
·
3 revisions
This page only applies for the CRAN version 0.2.0 and older
The dev version on github 0.2.0.9000 replaced the API with below steps
The package includes a function get_fedi_instances()
which currently doesn't work because the underlying API is dead.
If you want to get a list of instances, you can do so via instances.social Get a token from here and, optionally save it as an environment variable "INSTANCES_TOKEN"
library(httr)
library(dplyr)
config <- add_headers(Authorization = paste('Bearer', Sys.getenv("INSTANCES_TOKEN")))
params <- list(count = 0)
df <- GET("https://instances.social/api/1.0/instances/list",query = params,config)
tbl <- bind_rows(content(df)$instances)
tbl
#> # A tibble: 27,877 × 24
#> id name updat…¹ check…² uptime up dead version ipv6 https…³ https…⁴
#> <chr> <chr> <chr> <chr> <int> <lgl> <lgl> <chr> <lgl> <int> <chr>
#> 1 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 2 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 3 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 4 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 5 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 6 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 7 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 8 58e10… mast… 2022-1… 2022-1… 1 TRUE FALSE 4.0.2 TRUE 100 "A+"
#> 9 58e11… awoo… 2022-1… 2022-1… 1 TRUE FALSE 3.5.3+… TRUE 5 "F "
#> 10 58e11… awoo… 2022-1… 2022-1… 1 TRUE FALSE 3.5.3+… TRUE 5 "F "
#> # … with 27,867 more rows, 13 more variables: obs_score <int>, obs_rank <chr>,
#> # users <chr>, statuses <chr>, connections <chr>, open_registrations <lgl>,
#> # info <named list>, thumbnail <chr>, thumbnail_proxy <chr>,
#> # active_users <int>, email <chr>, admin <chr>, added_at <chr>, and
#> # abbreviated variable names ¹updated_at, ²checked_at, ³https_score,
#> # ⁴https_rank
# select only a few relevant columns
tbl |>
select(name,users,statuses,version) |>
distinct() |>
mutate(users=as.numeric(users),statuses=as.numeric(statuses))
#> # A tibble: 16,383 × 4
#> name users statuses version
#> <chr> <dbl> <dbl> <chr>
#> 1 mastodon.xyz 24145 1799263 4.0.2
#> 2 awoo.space 1735 620607 3.5.3+glitch
#> 3 social.tchncs.de 19641 1774724 4.0.2
#> 4 animalliberation.social 1229 3444 3.0.0
#> 5 icosahedron.website 851 374970 4.0.2
#> 6 hostux.social 7146 301542 4.0.2
#> 7 social.diskseven.com 1 77722 4.0.2
#> 8 social.imirhil.fr 3 48603 4.0.2
#> 9 sdfn-01.ninjawedding.org 3 10426 3.4.0+glitch
#> 10 aleph.land 1607 220599 4.0.1+glitch
#> # … with 16,373 more rows
Created on 2022-12-14 with reprex v2.0.2