CleanUnroll

Hex.pm VersionHex DocsHex.pm License

Unroll URLs and remove their tracking parameters

Installation

This package can be installed by adding clean_unroll to your list of dependencies in mix.exs:

def deps do
  [
    {:clean_unroll, "~> 0.1"}
  ]
end

Examples

iex> CleanUnroll.clean_unroll("https://example.com/page?utm_source=twitter&id=123")
{:ok, "https://example.com/page?id=123"}

iex> CleanUnroll.clean_unroll("https://example.com/page?custom_param=value", ["custom_param"])
{:ok, "https://example.com/page"}

iex> CleanUnroll.clean("https://example.com/page?utm_source=twitter&id=123")
"https://example.com/page?id=123"

iex> CleanUnroll.unroll("https://t.co/shortened")
{:ok, "https://example.com/full-url"}

License

CleanUnroll is released under the Apache License 2.0.

About

This package was written by Elliot Jackson.