YOURLS Kit is a bit of Swift that allows you to shorten and expand links using YOURLS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
YOURLSKit.xcodeproj
YOURLSKit
YOURLSKitTests
.gitignore
LICENSE
README.md

README.md

YOURLSKit

YOURLS Kit is a bit of Swift that allows you to shorten and expand links using your YOURLS server.

I'd be happy to accept pull requests.

To create an instance:

let yourls = YOURLSClient(yourlsSignature: "your_yourls_signature", yourlsBaseUrl: "http://youryourlsurl.xxx/")

To shorten a link:

yourls.shorten(expandedURL: "http://jerryfahrni.com/ptug/") { (link: YOURLSLink?, error: Error?) in
  if let link = link {
    print("short link ==> \(link.shortLink)")
  }
}

To expand a link:

yourls.expand(shortURL: "http://youryourlsurl.xxx/ptug/") { (link: YOURLSLink?, error: Error?) in
  if let link = link {
    print("expanded link ==> \(link.expandedLink)")
  }
}

Rob Fahrni, August 27, 2017