🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

polr-api

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

polr-api

A simple API wrapper for polr-powered URL shortners.

1.1.5
unpublished
latest
Version published
Maintainers
1
Created

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);
});

FAQs

Package last updated on 12 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts