rtweet (version 0.3.7)

get_followers: get_followers

Description

Returns max followers per token

Usage

get_followers(user, n = 75000, page = "-1", parse = TRUE, as_double = FALSE, token = NULL)

Arguments

user
Screen name or user id of target user.
n
Number of followers to return. For max return, enter n = "all" or n = 75000 (max per token).
page
Default page = -1 specifies first page of json results. Other pages specified via cursor values supplied by Twitter API response object.
parse
Logical, indicating whether to return parsed vector or nested list (fromJSON) object. By default, parse = TRUE saves you the time [and frustrations] associated with disentangling the Twitter API return objects.
as_double
logical indicating whether to handle ID variables as double (numeric) class. By default, this is set to FALSE, meaning ID variables are treated as character vectors. Setting this to TRUE can provide performance (speed and memory) boost but can also lead to issues when printing and saving, depending on the format.
token
OAuth token. By default token = NULL fetches a non-exhausted token from an environment variable. Find instructions on how to create tokens and setup an environment variable in the tokens vignette (in r, send ?tokens to console).

Value

list of follower ids and next page value (presumably this would be used in loops extracting more than 75,000 followers using either multiple tokens or by waiting out rate limits)

See Also

https://dev.twitter.com/overview/documentation

Other ids: get_friends, next_cursor

Examples

Run this code
## Not run: 
# # get ids of users following the president of the US
# pres <- get_followers(user = "potus")
# pres
# 
# # get ids of users following the Environmental Protection Agency
# epa <- get_followers(user = "epa")
# epa
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace