get_friends_fast: Wrapper for rtweet::get_friends and rtweet::lookup_users

View source: R/get_followers_and_friends_fast.R

get_friends_fastR Documentation

Wrapper for rtweet::get_friends and rtweet::lookup_users

Description

This function consolidates the process of getting friends and looking up the user details. Additional columns are created for account friendship reference, friend_no, and earliest friendship date.

Usage

get_friends_fast(account_for_friend, token_list = c(NULL), file_path = NULL)

Arguments

account_for_friend

Required. The target twitter account user_id or screen_name - in quotes. NB:Only tested with a single account: iterating tokens may not work effectively with multiple accounts, however, using lapply or purrr::map to iterate over user accounts is feasible.

token_list

Optional. A list of valid tokens loaded into environment. Not specifying will use the default token. If multiple tokens are specified, function will iterate through them to reduce ratelimit pauses for friends more than 75000 NB: this may be contrary to Twitter's API terms and conditions - so use at own risk.

file_path

Optional. If specified, an rds file will be saved to the file path in the form <file_path><account_for_friend>_friends.rds #'@keywords twitter, rtweet

Examples

jacks_friends <- get_friends_fast("arfness",token_list = c(NULL), file_path = "~/")

Arf9999/rtweetXtras documentation built on June 27, 2022, 5:10 a.m.