rtweet (version 0.3.0)

get_followers: get_followers

Description

Returns max followers per token

Usage

get_followers(user, n = 75000, page = "-1", parse = TRUE, 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.

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
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace