3clean-url is a command-line tool for cleaning URLs.
5I have text expansion macros that insert the URLs from my frontmost browser window, and this tool cleans up the URL before insertion.
6It removes tracking and referral parameters, unwanted URL suffixes, and generally de-junks URLs.
10You need Rust installed; I recommend using [Rustup].
11Then clone this repository and compile the code:
14$ git clone
"git://alexwlchan.net/projects/clean-url.git"
16$ cargo install --path .
19[
Rustup]:
https://rustup.rs/
23clean-url takes a single argument: the URL to be cleaned.
27$ clean-url
"https://www.etsy.com/uk/listing/689034321/pride-flag-planets-complete-set-cross?ls=s&ga_order=most_relevant&ga_search_type=all&ga_view_type=gallery&ga_search_query=mathysphere+pride+planets&ref=sr_gallery-1-3&dd=1&content_source=750fbda2-0f23-409a-b29d-9714dc4e0ba3%253ALTcadfd6ad1b51d9f2c43bf9fc61aa37ee3ee5cc68&organic_search_click=1&logging_key=750fbda2-0f23-409a-b29d-9714dc4e0ba3%3ALTcadfd6ad1b51d9f2c43bf9fc61aa37ee3ee5cc68"
28https://www.etsy.com/uk/listing/689034321/pride-flag-planets-complete-set-cross⏎
31Note: output is printed without a trailing new line, so it integrates cleanly with my text expansion macros.
35This project is shared under the [
MIT license](
./LICENSE).