Retrieves all tweets of a keyword provided by the user through the Twitter API. Alternatively the user can directly read from a structured Json response based on the Twitter API. If the user plans to access to the Twitter API they must have a personal bearer token and store it as an environment variable to access it.

get_store(
  bearer_token,
  keyword,
  start_date,
  end_date,
  max_results = 25,
  store_path = "/output/",
  store_csv = TRUE,
  include_public_metrics = TRUE,
  api_access_lvl = "essential"
)

Arguments

bearer_token

The user's personal twitter API dev bearer token. It is recommended to add the token from an environment variable.

keyword

The keyword to search Twitter and retrieve tweets.

start_date

Starting date to collect tweets from. Dates should be entered in string format: YYYY-MM-DD

end_date

Ending date (Included) to collect tweets from. Dates should be entered in string format: YYYY-MM-DD

max_results

The maximum number of tweets to return. Default is 25.Must be between 10 and 100.

store_path

The string path to store the retrieved tweets in Json format. Default is working directory.

store_csv

Create .csv file with response data or not. Default is False.

include_public_metrics

Should public metrics regarding each tweet such as impression_count, like_count, reply_count, retweet_count, url_link_clicks and user_profile_clicks be downloaded and stored. Default is True.

api_access_lvl

The twitter API access level of the user's bearer token. Options are 'essential' or 'academic'. Default is 'essential'

Value

dataframe A dataframe of retrieved tweets based on user's selected parameters. (Data will be stored as a Json file)