search_loop: Runs the search loop

View source: R/search.R

search_loopR Documentation

Runs the search loop

Description

Infinite loop ensuring the permanent collection of tweets

Usage

search_loop(data_dir = NA)

Arguments

data_dir

optional path to the 'data directory' containing application settings, models and collected tweets. If not provided it will reuse the last set on the current session. If not provided the system will try to reuse the existing one from last session call of setup_config or use the EPI_HOME environment variable, Default: NA

Details

The detect loop is a pure R function designed for downloading tweets from the Twitter search API. It can handle several topics ensuring that all of them will be downloaded fairly using a round-robin philosophy and respecting Twitter API rate-limits.

The progress of this task is reported on the 'topics.json' file which is read or created by this function. This function will try to collect tweets respecting a 'collect_span' window in minutes, which is defined on the Shiny app and defaults to 60 minutes.

To see more details about the collection algorithm please see epitweetr vignette.

In order to work, this task needs Twitter credentials, which can be set on the Shiny app or using set_twitter_app_auth

Value

Nothing

See Also

set_twitter_app_auth

Examples

if(FALSE){
   #Running the search loop
   library(epitweetr)
   message('Please choose the epitweetr data directory')
   search_loop(file.choose())
}

epitweetr documentation built on Nov. 16, 2023, 5:07 p.m.