get_lang_tweets {academictwitteR} | R Documentation |
Get tweets in particular language 'r lifecycle::badge("deprecated")
Description
This function collects tweets containing strings or hashtags between specified date ranges filtering by language. Tweet-level data is stored in a data/ path as a series of JSONs beginning "data_"; User-level data is stored as a series of JSONs beginning "users_". If a filename is supplied, this function will save the result as a RDS file, otherwise it will return the results as a dataframe.
Usage
get_lang_tweets(
query,
lang,
start_tweets,
end_tweets,
bearer_token = get_bearer(),
n = 100,
file = NULL,
data_path = NULL,
bind_tweets = TRUE,
verbose = TRUE,
...
)
Arguments
query |
string or character vector, search query or queries |
lang |
string, a single BCP 47 language identifier e.g. "fr" |
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 |
bind_tweets |
If |
verbose |
If |
... |
arguments will be passed to |
Value
a data.frame
Examples
## Not run:
bearer_token <- "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
get_lang_tweets("bonne", lang= "fr",
"2021-01-01T00:00:00Z", "2021-01-01T00:10:00Z",
bearer_token, data_path = "data/")
## End(Not run)