Methods
(inner) getKeyByUrl(url, callback)
Get a key for a URL. When the shortener is presented with
the returned key it will redirect to the URL passed here.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The full URL you intend to shorten |
callback |
function | callback(err,key); the $key is a string that should be passed to the shortner url. For example: http://glg.link/$key |
(inner) getUrlByKey(key, callback)
Get the URL for a key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | A key for the URL you wish to retrieve |
callback |
function | callback(err,url); the $url is a string |
(inner) shorten(url, callback)
A drop-in replacement for bit.ly's "shorten"
method with no guarantees it works correctly. =)
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL we want to shorten |
callback |
function | callback(err,res): res = { data: { url: $short_url } } |