#url #clear #clean

no-std clearurls

Clear URLS from tracking parameters with crowd-sourced rules from https://clearurls.xyz

4 releases

0.0.4 Sep 13, 2024
0.0.3 Sep 13, 2024
0.0.2 Sep 11, 2024
0.0.1 Jul 27, 2024

#565 in Network programming

Download history 237/week @ 2024-09-07 219/week @ 2024-09-14 141/week @ 2024-09-21 223/week @ 2024-09-28 170/week @ 2024-10-05 71/week @ 2024-10-12 102/week @ 2024-10-19 254/week @ 2024-10-26 315/week @ 2024-11-02 350/week @ 2024-11-09 235/week @ 2024-11-16 236/week @ 2024-11-23 176/week @ 2024-11-30

1,062 downloads per month
Used in 8 crates (via lemmy_utils)

LGPL-3.0-only

37KB
742 lines

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

Dependencies

~4–14MB
~171K SLoC