Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This is my playground. It's where experiments with new technology happen, benchmarks of different things. Many real projects start their life here.
Clojure Python Objective-C JavaScript Java PHP Other
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Generative-poetry @ 106cb3d
GithubFriends @ 4117c60
HipsterVision @ 1eeddaf
HowOld/HowOld
JusThePics @ c74ddae
TweetAWakeup
ants
d3-tutorial
for-loops
iospeedtest
lib
node-bitly
node-unshortener @ a3e420b
nodestagram @ 294b691
poem-generation
polyglots
prefetch_vs_related
project-euler
serverbench
socket.io-testing socket.io-testing tutorial thingy
test
.gitignore
.gitmodules
99-lisp.clj
README.md
aho-corasick.hs
evolve-text.py
fibonacci.clj
index.js
machine-140.json
machine.json
machine2.json
package.json
settings.js
silly-bug.html
skype-parser.py
turing-140.js
turing.js

README.md

<<<<<<< HEAD

This is my playground, there is a lot of stupid stuff going on here so it's probably best you don't really look at it

node-unshortener 0.0.8

A simple library that can unshorten any short url.

Install

 npm install unshortener

or

 git clone https://github.com/Swizec/node-unshortener.git
 cd node-unshortener
 npm link

Usage

     // expand an URL
     var unshortener = require('unshortener');

     // you can pass in a url object or string
     unshortener.expand('http://t.co/rWP6BP3',
                        function (url) {
                             // url is a url object
                             console.log(url);
                        });

If you have a handy bitly account you should also pass in an options object to enable the unshortener to use the bitly API directly:

     // expand an URL
     var unshortener = require('unshortener');

     // you can pass in a url object or string
     unshortener.expand('http://t.co/rWP6BP3',
                        {bitly: {username: '<YOUR BITLY USERNAME>',
                                 apikey: '<YOUR BITLY API KEY>'}},
                        function (url) {
                             // url is a url object
                             console.log(url);
                        });

When an error occurs the callback is passed the original url and an error flag.

How it works

node-unshortener aims to be able to unshorten any link possible, so it tries to behave as a browser and simply follows all the redirects. However, to be nice, when at all possible, it tries to use the url shortener's official API.

That said, please feel free to suggest any unshortening services I may have missed.

Services/domains directly supported so far:

  • bit.ly
  • j.mp
  • is.gd
  • goo.gl
  • ericri.es
  • jc.is
  • nyti.ms
  • linkd.in
  • win.gs
  • budurl.com
  • cli.gs
  • snipurl.com
  • snurl.com
  • cl.lk
  • snipr.com
  • sn.im
  • dai.ly
  • imgry.net
  • mln.im
  • theatln.tc
  • rww.to

License

Copyright (C) Swizec Teller swizec@swizec.com

Licensed under the GPL version 3 or later for non-commercial use.

For commercial use please consider purchasing a commercial license to support my work.

01f5bb578ec133ed9300f390d2ec245dbb9e1ccc

Something went wrong with that request. Please try again.