Description Usage Arguments Value WARNING
View source: R/get_user_tweets.R
Given a tweet IDs JSON, a user.id, and a start and end date,
function looks for existing tweets data
and gets tweets for the remaining date range(s) by calling get_all_tweets
.
1 2 3 4 | get_user_tweets(ids.file, user.id, since, until,
token = rtweet::get_token(), .write.out = TRUE, .data.path,
.file.stem = paste0("tw_user_", user.id, "_tweets_%s.RData"),
.write.fun = saveRDS, verbose = TRUE)
|
ids.file |
path to a tweet IDs JSON (as written by scrape_tweet_ids or get_user_tweet_ids) |
user.id |
is the user ID of a twitter user |
since |
a date (format '%Y-%m-%d'), specifying the start of the date range to be requested |
until |
a date (format '%Y-%m-%d'), specifying the end of the date range to be requested |
token |
an Twitter OAuth |
.write.out |
logical. write out tweet IDs as JSON to disk?
If |
.data.path |
Path to look at for existing tweet ID files
Also the path where new ID files are written if |
.file.stem |
file name stem (stem ignores date ranges).
Defaults to glob 'tw_user_< |
.write.fun |
function used to write data output list. Note that you cannot use write.csv or any other table-like writer, as the outputted data is a list object. |
verbose |
logical. Print out status messages? |
A list object with three elements
'tweets': tibble
data frame containing the tweets data.
'data_pathes': a chracter vector, specifiying the paths of all tweets data files if any exist or new were written
'failures': tibble
data frame reporting warnings and errors raised while trying to get tweets data.
Function presuposses a valid Twitter OAuth token.
Function only accepts dates in format '%Y-%m-%d' (Year-month-day: 'YYYY-mm-dd')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.