Socket
Socket
Sign inDemoInstall

bitlyapi

Package Overview
Dependencies
120
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bitlyapi

Bitly api


Version published
Weekly downloads
22
increased by57.14%
Maintainers
1
Install size
6.27 MB
Created
Weekly downloads
 

Readme

Source

This is the API of bitly.com

Build Status npm version

Installation

Using NPM npm install bitlyapi

Using GIT git clone https://github.com/kishanmadhesiya/bitly.git

Usage

You need 'ACCESS TOKEN' from bitly.com. Visit: https://bitly.com/a/oauth_apps

Check http://dev.bitly.com/ for more info.

Code
// For ES2015/ES6

import Bitly from 'bitlyapi';

let bitly = new Bitly('<ACCESS TOKEN>');

bitly.shorten('http://nodejs.org', (response) => {
  console.log(response);
}, (error) => {
  console.log(error);
});


// For ES5

var Bitly = require('bitlyapi');
var bitly = new Bitly('<ACCESS TOKEN>');

bitly.shorten('https://github.com/kishanmadhesiya/bitly')
  .then(function(response) {
    console.log(response);
  }, function(error) {
    console.log(error);
  });

Bit.ly Api Features

  • shorten() uses:- shorten(LONG_URL)

  • expand()
    uses:- expand(BITLY_HASH) or expand([SHORT_URL, BITLY_HASH]) or expand(SHORT_URL)

  • clicks()
    uses:- clicks(BITLY_HASH) or clicks([SHORT_URL, BITLY_HASH]) or clicks(SHORT_URL)

  • clicksByMinute() uses:- clicksByMinute(BITLY_HASH) or clicksByMinute([SHORT_URL, BITLY_HASH]) or clicksByMinute(SHORT_URL)

  • clicksByDay() uses:- clicksByDay(BITLY_HASH) or clicksByDay([SHORT_URL, BITLY_HASH]) or clicksByDay(SHORT_URL)

  • referrers() uses:- referrers(SHORT_URL) or referrers(BITLY_HASH)

  • countries() uses:- countries(BITLY_HASH) or countries(SHORT_URL)

  • bitlyProDomain() uses:- bitlyProDomain(LONG_URL)

  • lookup() uses:- lookup([LONG_URL, 'http://kishanmadhesiya.com']) or lookup(LONG_URL)

  • info() info(BITLY_HASH) or info([SHORT_URL, BITLY_HASH]) or info(SHORT_URL)

  • history() uses:- history()

  • linkEdit() uses:- linkEdit(metadata_field, link, new_value)

Tests

To run tests type npm test. For coverage type npm run coverage

Keywords

FAQs

Last updated on 02 Jul 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