Expand shortened urls.
CoffeeScript JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
misc
src
test
.gitignore
.npmignore
Cakefile
README.md
package.json

README.md

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