R/lists_users.R

Defines functions lists_users

Documented in lists_users

#' Get all lists a specified user subscribes to, including their own.
#'
#' @inheritParams get_timeline
#' @param reverse optional Set this to true if you would like owned lists
#'   to be returned first. See description above for information on
#'   how this parameter works.
#' @return data
#' @examples
#' if (auth_has_default()) {
#'
#' ## get lists subscribed to by R_Foundation
#' lists_users("ropensci")
#'
#' }
#'
#' @family lists
#' @export
lists_users <- function(user = NULL, reverse = FALSE, token = NULL, parse = TRUE) {
  params <- list(
    reverse = reverse
  )
  params[[user_type(user)]] <- user

  r <- TWIT_get(token, "/1.1/lists/list", params)
  if (parse) {
    r <- as_lists_users(r)
    r <- as.data.frame(r)
  }
  r
}

Try the rtweet package in your browser

Any scripts or data that you put into this service are public.

rtweet documentation built on Oct. 17, 2023, 1:11 a.m.