node-bitly - Bitly API for nodejs
This module provides calls to the Bitly API for Nodejs.
For more information on the API request and responses visit the Bitly API docs
Installation
To install via NPM type the following: npm install bitly
You can also install via git by cloning: git clone https://github.com/tanepiper/node-bitly.git /path/to/bitly
Usage
var Bitly = require('bitly');
var bitly = new Bitly('<YOUR ACCESS TOKEN>');
bitly.shorten('https://github.com/tanepiper/node-bitly', function(err, response) {
if (err) throw err;
var short_url = response.data.url
});
bitly.shorten('https://github.com/tanepiper/node-bitly')
.then(function(response) {
var short_url = response.data.url
}, function(error) {
throw error;
});
Tests
To run tests type npm test
Bit.ly Features
This module is limited to the following API methods:
- shorten
- expand
- clicks / clicks_by_minute / clicks_by_day
- referrers
- countries
- bitly_pro_domain
- lookup
- info
- history
- link_edit