Packages

Parse, classify, and normalize Pinterest URLs without network requests.

Current section

Files

Jump to

README.md

# Pinterest URL Normalizer for Elixir
Parse, classify, and normalize Pinterest URLs without network requests. The
package uses an exact Pinterest host allowlist and rejects lookalike domains,
credentials, non-HTTPS URLs, encoded paths, and non-standard ports.
## Installation
Add `pinterest_url_normalizer` to your dependencies:
```elixir
def deps do
[
{:pinterest_url_normalizer, "~> 0.1.1"}
]
end
```
## Usage
```elixir
PinterestUrlNormalizer.normalize(
"https://www.pinterest.co.uk/pin/example--123456789/?utm_source=test"
)
# "https://www.pinterest.com/pin/123456789/"
```
Supported URL classes are Pin, `pin.it` short link, profile, board, and Ideas.
This package does not download media or make network requests. For a browser
tool that handles the next image step, use the [Pinterest image downloader](https://savepinner.com/).
MIT licensed.