Description Usage Arguments Details Value
safe_get_followers()
is a drop-in replacement for
rtweet::get_followers()
that automatically respects
Twitter API rate limits and coordinates use of
multiple Twitter access tokens that have been
registered with register_token()
. At the moment
you can only request the friends list of 15 or
fewer users in a single call.
1 | safe_get_followers(users, n = 5000, page = -1, verbose = FALSE, attempts = 5)
|
n |
Number of followers to return. Defaults to 5000, which is the max number of followers returned by a single API request. Twitter allows up to 15 of these requests every 15 minutes, which means 75,000 is the max number of followers to return without waiting for the rate limit to reset. If this number exceeds either 75,000 or the remaining number of possible requests for a given token, then the returned object will only return what it can (less than n) unless retryonratelimit is set to true. |
page |
Default |
verbose |
Logical indicating whether or not to print messages. Only relevant if retryonratelimit = TRUE. Defaults to TRUE, prints sleep times and followers gathered counts. |
attempts |
How many times should we attempt to access the Twitter API before giving up? Defaults to 5. |
If no tokens have been registered with socialsampler
,
safe_get_followers()
will look for a token registered
with rtweet
and use that token instead, again
automatically respecting rate limits. If no tokens have
been registered with either socialsampler
or rtweet
,
you'll get an error.
An edgelist with columns:
from
: A character vector of node ids. This will match the
input format of users
. That is, if users
consists of
screen names, from
will consist of screen names. If
users
consists of user IDs, from
will as well.
to
: A character vector of node ids.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.