clearurls

Crates.ioclearurls
lib.rsclearurls
version0.0.4
sourcesrc
created_at2024-07-27 20:49:11.21313
updated_at2024-09-13 20:04:07.627076
descriptionClear URLS from tracking parameters with crowd-sourced rules from https://clearurls.xyz
homepage
repositoryhttps://github.com/jendrikw/clearurls
max_upload_size
id1317512
size87,725
Jendrik (jendrikw)

documentation

README

clearurls

GitHub Actions Workflow Status Crate Docs

Bringing the power of the ClearURLs rules to Rust. Easily remove tracking parameters and other nuisance from URLs with a simple API:

use clearurls::UrlCleaner;
fn main() -> Result<(), clearurls::Error> {
    let cleaner = UrlCleaner::from_embedded_rules()?;
    let res = cleaner.clear_single_url_str("https://example.com/test?utm_source=abc")?;
    assert_eq!(res, "https://example.com/test");
    Ok(())
}

Crate Features

There is a std feature (enabled by default) to include utility functions to read from files, but the core logic doesn't depend on that and the crate is perfectly usable without std.

Acknowledgements

data.minify.json was downloaded from https://github.com/ClearURLs/Rules

License

data.minify.json file is from https://github.com/ClearURLs/Rules Testcases are from

Commit count: 0

cargo fmt