Bitly.shortenLink()

Generate a bitly URL

Given a long URL, create a shortened link using the bitly API.

Usage

Hover over inputs/exits for more info.

var Bitly = require('machinepack-bitly');


// Generate a bitly URL

Bitly.shortenLink({

clientId: 'xyz123abcxxx',

clientSecret: 'xyz123abcxxx',

accessToken: 'xyz123abcxxx',

url: 'http://www.somereallylongurl.com/man/that/is/long.html',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

clientId required

Your bitly OAuth client ID

'xyz123abcxxx'
clientSecret required

Your bitly OAuth client secret

'xyz123abcxxx'
accessToken required

Your bitly OAuth access token

'xyz123abcxxx'
url required

The URL to shorten

'http://www.somereallylongurl.com/man/that/is/long.html'

Exits

error

An unexpected error occurred.

success

OK.

'http://bit.ly/abc123'