Socket
Socket
Sign inDemoInstall

polr-api

Package Overview
Dependencies
47
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

polr-api

A simple API wrapper for polr-powered URL shortners.


Version published
Maintainers
1
0

Weekly downloads

Readme

Source

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

Keywords

FAQs

Last updated on 12 Sep 2017

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc