Learn R Programming

Tivy (version 0.1.1)

fetch_fishing_announcements: Fetch fishing announcements from external sources

Description

Retrieves fishing announcements from official websites within a specified date range. This function is specifically designed for PRODUCE (Peru) but can be adapted for other sources.

Usage

fetch_fishing_announcements(
  start_date,
  end_date,
  download = FALSE,
  download_dir = "downloads",
  batch_size = 10,
  verbose = TRUE,
  source_url = NULL,
  max_records = 5000
)

Value

Data frame with announcement information and download links.

Arguments

start_date

Start date in "dd/mm/yyyy" format.

end_date

End date in "dd/mm/yyyy" format.

download

Logical. Download PDF files.

download_dir

Directory for downloaded files.

batch_size

Records per request.

verbose

Print detailed information.

source_url

Base URL for the announcement source. Defaults to the PRODUCE page: https://consultasenlinea.produce.gob.pe/ConsultasEnLinea/consultas.web/comunicados/suspensionPreventiva

max_records

Maximum records to retrieve.

Examples

Run this code
if (FALSE) {
announcements <- fetch_fishing_announcements(
  start_date = "01/01/2023",
  end_date = "31/12/2023"
)

announcements <- fetch_fishing_announcements(
  start_date = "01/01/2023",
  end_date = "31/01/2023",
  download = TRUE,
  download_dir = "announcements"
)
}

Run the code above in your browser using DataLab