Crate tracking_params

Source
Expand description

§tracking-params

Removes unwanted tracking parameters from a given URLs.

let dirty_url = url::Url::parse("https://twitter.com/elonmusk/status/1608273870901096454?ref_src=twsrc%5EdUmBgUY")?;
let clean_url = tracking_params::clean(dirty_url); // returns `Cleaned` which derefs to `url::Url`

assert_eq!(
    clean_url.to_string(),
    "https://twitter.com/elonmusk/status/1608273870901096454".to_string() // No `ref_src` tracking params
);

Structs§

Cleaned
A cleaned URL.

Functions§

clean
Removes tracking parameters from a given Url type.
clean_str
Removes tracking parameters from a given string reference that is expected to be a valid URL.
clean_str_raw
Same as clean_str but returns the Cleaned type