1.1.5 • Published 7 years ago
polr-api v1.1.5
polr-api is a little API wrapper for your own polr-powered URL shortening service. For now, it only supports link shortening, not lookups. If you don't have polr installed on your server yet, get it here.
Calling constructor :
var polrAPI = new polr.API("server hostname", "polr API key", "protocol(optional)");
note: protocol
can be either set to "http"
or "https"
. The default is "http"
Shortnening :
plorAPI.shorten("link", callback);
will shorten the URL in the "link"
parameter with the default server shornening parameters.
polrAPI.shortenCustom("link", "custom ending", callback);
will shorten the URL in the "link"
variable with the link ending specified in "custom ending" parameter.
Example :
var polr = require("polr-api");
polrApi = new polr.Api("server hostname", "polr API key", "protocol(optional)")
polrApi.shorten("link", function(res){
console.log(res);
});
Example :
var polr = require("polr-api");
polrApi = new polr.Api("server hostname", "polr API key", "protocol(optional)")
polrApi.shortenCustom("link", "custom ending", function(res){
console.log(res);
});