safe_lookup_users: Safely lookup Twitter users

Description Usage Arguments Details Value

View source: R/api-calls.R

Description

safe_lookup_users() is a drop-in replacement for rtweet::lookup_users() 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.

Usage

1
safe_lookup_users(users, attempts = 5)

Arguments

users

User id or screen name of target user.

attempts

How many times should we attempt to access the Twitter API before giving up? Defaults to 5.

Details

If no tokens have been registered with socialsampler, safe_lookup_users() 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.

Value

A tibble of users data.


alexpghayes/socialsampler documentation built on Jan. 3, 2022, 6:54 p.m.