Skip to content

Repository files navigation

Pinterest URL Normalizer for Swift

Parse, classify, and normalize Pinterest URLs without network requests. The library uses an exact Pinterest host allowlist and rejects lookalike domains, credentials, non-HTTPS URLs, encoded paths, and non-standard ports.

Swift Package Manager

dependencies: [
    .package(
        url: "https://github.com/jiankn/pinterest-url-normalizer-swift.git",
        from: "0.1.1"
    )
]

CocoaPods

pod 'PinterestURLNormalizer', '~> 0.1.1'

Usage

import PinterestURLNormalizer

let canonical = try 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. When an iOS app hands a canonical public Pin URL back to the user, SavePinner's Pinterest Downloader for iPhone explains the Safari download and Photos steps without requiring another app.

MIT licensed.

About

Zero-dependency Swift package for parsing and normalizing Pinterest URLs

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages