Skip to content

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

License

Notifications You must be signed in to change notification settings

Fahrni/YOURLSKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published