Skip to contents

Squishes white space, reduces doubled slashes and removes the query string, so that the same page reached by two spellings of its address counts once (ECB links carry a cache-busting hash after ?).

Usage

normalise_url(url)

Arguments

url

Character vector of URLs.

Value

A character vector, NA kept.

Details

Use it to compare addresses and to derive identifiers from them, not to request a page: a query string can be what selects the document. Identifiers of central_bank_database are hashes of these strings, so changing what this function returns would change them.

See also

Examples

normalise_url("https://www.ecb.europa.eu//press/key/date/2024/html/x.en.html?abc123")
#> [1] "https://www.ecb.europa.eu/press/key/date/2024/html/x.en.html"