fetch_all_links

Function fetch_all_links 

Source
pub async fn fetch_all_links() -> AppResult<(BTreeMap<String, String>, BTreeMap<String, String>)>
Expand description

Fetches all available ZIP file links from both procurement data sources.

This function sequentially fetches links from both the minor contracts and public tenders data source pages. It parses HTML to extract ZIP file links and extracts period identifiers (e.g., “202301”) from filenames.

§Returns

Returns a tuple containing maps of period strings to download URLs:

  • First element: Minor contracts links (period -> URL)
  • Second element: Public tenders links (period -> URL)

§Errors

Returns an error if:

  • Network requests fail
  • HTML parsing fails
  • URLs cannot be parsed