Fahrni / YOURLSKit

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

License:MIT License


Languages

Language:Swift 96.3%Language:Objective-C 3.7%