tweet_threading: Collect statuses contained in a thread

View source: R/tweet_threading.R

tweet_threadingR Documentation

Collect statuses contained in a thread

Description

Return all statuses that are part of a thread (Replies from a user to their own tweets). By default the function traverses first backwards from the origin status_id of the thread up to the root, then checks if there are any child statuses that were posted after the origin status.

Usage

tweet_threading(tw, traverse = c("backwards", "forwards"), verbose = FALSE)

Arguments

tw

lookup_tweets() output containing at least the last status in the thread or an id of a tweet.

traverse

character, direction to traverse from origin status in tw. It is not recommended to change the default if you don't know at which point of a thread you are starting.

verbose

logical, output to console status of traverse.

Details

The backwards method looks up the tweet which is replying to, so it works if starting from the last tweet of the thread.

The forwards method looks for newer replies to the tweet provided. If the tweet doesn't have a reply it won't be able to find anything. The forwards method is limited by the timeline API (See get_timeline()).

Value

Tweets in a structure like lookup_tweets().

Examples

if (auth_has_default()) {
tw_thread <- tweet_threading("1461776330584956929")
tw_thread
}

rtweet documentation built on Oct. 17, 2023, 1:11 a.m.