Skip to contents

Loads the package's curated seed lists of Russian and Chinese diplomatic and government Twitter accounts, keeps accounts that were still posting at the time the list was last checked, and joins scraped profile metadata (display name, description, follower counts, verification status) on the lowercased handle.

Usage

get_accounts(country, group = c("diplomats"), online = TRUE)

Arguments

country

one or both of "RU" and "CN"

group

account group to return; currently only "diplomats"

online

if TRUE (default), pulls the most recent data from the package's GitHub repository; requires an internet connection. If FALSE, uses the data bundled with the installed package.

Value

A tibble with one row per account: the originating state in state ("RU" or "CN"), seed-list variables (host country, ISO2 code, account category, Twitter handle) joined to the most recent profile scrape, with the scrape date in data_scraped.

See also

get_domains() for state-media domain lists

Examples

# \donttest{
ru_accs <- get_accounts(country = "RU", group = "diplomats")
#> 353 Russian diplomat and government accounts. Account data as of 2024-04-15.
head(ru_accs)
#> # A tibble: 6 × 24
#>   state country     ISO2  cat   twitter_handle  user_id           name  username
#>   <chr> <chr>       <chr> <chr> <chr>           <chr>             <chr> <chr>   
#> 1 RU    Afghanistan AF    E     RusEmbassyKabul 341458109         Russ… RusEmba…
#> 2 RU    Afghanistan AF    C     ruscg_mzs       7954575246107688… Russ… RusCG_M…
#> 3 RU    Albania     AL    E     RussianAlbania  1374099271763558… Russ… Russian…
#> 4 RU    Algeria     DZ    E     AmbRus_Algerie  343283070         Amba… AmbRus_…
#> 5 RU    Angola      AO    E     russembangola4  1428000388062617… russ… russemb…
#> 6 RU    Argentina   AR    E     EmbRusiaEnArgEs 340383579         Emba… EmbRusi…
#> # ℹ 16 more variables: created_at <dttm>, description <chr>, entities <lgl>,
#> #   location <chr>, profile_image_url <chr>, protected <lgl>,
#> #   followers_count <dbl>, following_count <dbl>, tweet_count <dbl>,
#> #   listed_count <dbl>, like_count <dbl>, url <chr>, verified <lgl>,
#> #   withheld <lgl>, deleted <lgl>, data_scraped <date>

all_accs <- get_accounts(country = c("RU", "CN"))
#> 293 Chinese diplomat and government accounts. Account data as of 2024-04-15.
#> 353 Russian diplomat and government accounts. Account data as of 2024-04-15.
# }