elongate

0.2.1 • Public • Published

Elongate -- Expand shortened urls

Install globally

  npm install -g elongate

Or locally for use as a library:

  npm install elongate

Or from source:

  git clone git://github.com/colinscape/elongate.git 
  cd elongate
  npm link

Super simple to use

If you installed it globally:

  $ elongate http://bit.ly/TAA2AL

If installed as a library:

  elongate = require 'elongate'

  elongate 'http://bit.ly/TAA2AL', (err, destination_url) ->
    console.log "Destination log is #{destination_url}"

or for the full redirect chain:

  elongate = require 'elongate'

  elongate 'http://bit.ly/TAA2AL', (err, destination_url, all_urls) ->
    console.log intermediate_url for intermediate_url in all_urls

Or, as JavaScript:

  var elongate = require('elongate')

  elongate('http://bit.ly/TAA2AL', function(err, destination_url) {
    console.log('Destination url is ' + destination_url);
  });
  var elongate = require('elongate')

  elongate('http://bit.ly/TAA2AL', function(err, destination_url, all_urls) {
    for (var i=0; i < all_urls.length; ++i) {
      console.log(all_urls[i]);  
    }
  });

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i elongate

    Weekly Downloads

    3

    Version

    0.2.1

    License

    BSD

    Last publish

    Collaborators

    • colinscape