get_user_timeline {academictwitteR} | R Documentation |
Get tweets by a single user
Description
This function collects tweets by an user ID from the users endpoint.
Usage
get_user_timeline(
x,
start_tweets,
end_tweets,
bearer_token = get_bearer(),
n = 100,
file = NULL,
data_path = NULL,
export_query = TRUE,
bind_tweets = TRUE,
page_n = 100,
verbose = TRUE,
...
)
Arguments
x |
string containing one user id or a vector of user ids |
start_tweets |
string, starting date |
end_tweets |
string, ending date |
bearer_token |
string, bearer token |
n |
integer, upper limit of tweets to be fetched |
file |
string, name of the resulting RDS file |
data_path |
string, if supplied, fetched data can be saved to the designated path as jsons |
export_query |
If |
bind_tweets |
If |
page_n |
integer, amount of tweets to be returned by per page |
verbose |
If |
... |
arguments will be passed to |
Details
Only the most recent 3,200 Tweets can be retrieved.
If a filename is supplied, the function will save the result as a RDS file.
If a data path is supplied, the function will also return tweet-level data in a data/ path as a series of JSONs beginning "data_"; while user-level data will be returned as a series of JSONs beginning "users_".
When bind_tweets is TRUE
, the function returns a data frame.
Value
a data.frame
Examples
## Not run:
get_user_timeline("2244994945",
start_tweets = "2020-01-01T00:00:00Z",
end_tweets = "2021-05-14T00:00:00Z",
bearer_token = get_bearer(),
n = 200)
## End(Not run)