# Early Detection of Public Health Threats from Social Media Data

## Documentation for package ‘episomer’ version 3.0.32

- DESCRIPTION file.
- User guides, package vignettes and other documentation.

## Help Pages

add_new_social_media | Create new social media template files, so a developer can extend episomer and support a new social media. this function has to be called within episomer subfolder containing thr R subfolder after executing devtools::load_all()
admin_app | Run the episomer Shiny app
bluesky_check_token_validity | check the current bluesky token validity
bluesky_create_session | Get bearer token
bluesky_format_date | formats a date in the expected bluesky format
bluesky_parse_date | parse a date as provided by bluesky into a date_time object
bluesky_parse_features | extracts features from the post structure returned by the bluesky api
bluesky_parse_quoted | extracts the quotes information from a post in one of the many possible locations found in bluesky format
bluesky_parse_response | parses the response of bluesky API into the standardised episomer format. For more details see the vignette.
bluesky_rate_limited_check | function to check if there has been a rate limit error returned by the bluesky API
bluesky_rerun_after_rate_limit | function to extract the number of seconds to wait after a rate limit has been reached
calculate_regions_alerts | calculate alerts for for a particular region
calculate_region_alerts | calculate alerts for for a particular region
check_all | Run automatic sanity checks
create_api_and_plan_files_for_new_social_media | internal function for producing the code template for a new social media
create_map | Plot the map report on the episomer dashboard
create_snapshot | Snapshot of your episomer installation
create_topchart | Plot the top elements for a specific series on the episomer dashboard
create_topwords | Plot the top words report on the episomer dashboard
dashboard_app | Run the episomer Shiny app
detect_loop | Runs the detect loop
download_dependencies | Updates Java dependencies
ears_t_reweighted | algorithm for outbreak detection, extends the EARS algorithm
episomer_app | Run the episomer Shiny app
fs_loop | Runs the episomer embedded database loop
generate_alerts | Execute the alert task
geolocate_text | geolocate text in a data frame given a text column and optionally a language column
get_aggregates | Getting already aggregated time series produced by 'detect_loop'
get_alerts | Getting signals produced by the task 'generate_alerts' of 'detect_loop'
get_tasks | Get the 'detect_loop' task status
health_check | Send email to administrator if a failure of episomer is detected
is_detect_running | Check whether the alert detection task is running
is_fs_running | Check whether the database is running
is_r_folder_present | check whether the R folder is present in the current directory
is_search_running | Check whether the post collection task is running
keep_roxygen_and_function_declarations | internal function for exporting code of necessary functions for creating templates for a new social media
missing_search_jobs | Missing search jobs if any
register_detect_runner_task | Registers the alert detection task
register_fs_monitor | Registers the fs_monitor for the current process or exits
register_fs_runner_task | Registers the episomer database task
register_search_runner_task | Registers the social media message collection task
save_config | Save the configuration changes
search_loop | Runs the search loop
search_loop_worker | Runs the search loop
search_posts | perform full text search on posts collected with episomer
search_topic | performs a search following the given plan, query and topic.
search_touch | updates the modificatin date of a flag file indicating that messages have been sent to the embedded database.
setup_config | Load episomer application settings
sm_api_get_token | Get social media token
sm_api_get_token_bluesky | Get social media token
sm_api_got_rows_bluesky | Receive the results provided by a request and return a logical value indicating whether the request returned results.
sm_api_search | Search posts for a given query and produce standardised results
sm_api_search_bluesky | Search posts for a given query and produce standardised results
sm_api_set_auth | Save credentials for a social media provider and store them securely
sm_api_set_auth_bluesky | Save bluesky credentials (login and password) and store them securely
sm_api_translate_query | Translate a parsed query to the social media query format
sm_api_translate_query_bluesky | Translate a parsed query to the social media query format
sm_api_update_plan_after_request | Takes a plan after a request has been performed and the standardised results provided as returned by the function sm_api_search_xxx it should return a plan with necessary information updated so next request will continue paginating as expected to obtain targeted messages
sm_api_update_plan_after_request_bluesky | Takes a plan after a request has been performed and the standardised results provided as returned by the function sm_api_search_xxx it should return a plan with necessary information updated so next request will continue paginating as expected to obtain targeted messages
sm_plan_first_attributes | returns a list with the custom social media plan attributes with the default values for a first plan in a topic.
sm_plan_first_attributes_bluesky | returns a list with the custom social media plan attributes with the default values for a first plan in a topic.
sm_plan_format | prepare a plan for serialisation by transforming attributes with non standard serialisation types e.g. dates to string on the format expected by the parse functions
sm_plan_format_bluesky | prepare a plan for serialisation by transforming attributes with non standard serialisation types e.g. dates to string on the format expected by the parse functions
sm_plan_get_progress | calculates and returns the estimated progress of a plan using custom attributes
sm_plan_get_progress_bluesky | calculates and returns the estimated progress of a plan using custom attributes
sm_plan_next_attributes | returns a list with the custom social media plan attributes with the values for the plan to be run after the plans provided as parameter
sm_plan_next_attributes_bluesky | returns a list with the custom social media plan attributes with the values for the plan to be run after the plans provided as parameter
sm_plan_next_search_info | Return a message to log what the next query is going to be for the current plan
sm_plan_parse_attributes | parse custom attributes for a plan in this specific social media and returns them as a named list with attributes in the proper type
sm_plan_parse_attributes_bluesky | parse custom attributes for a plan in this specific social media and returns them as a named list with attributes in the proper type
sm_plan_search_info_bluesky | Return a message to log what the next query is going to be for the current plan
stop_detect_runner_task | Stops the alert detection task
stop_fs_runner_task | Stops the episomer database task
stop_search_runner_task | Stops the post collection task
trend_line | Plot the trendline report of episomer dashboard
update_geonames | Updates the local copy of the GeoNames database
update_languages | Updates local copies of languages