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
Permalink
Failed to load latest commit information.
Generative-poetry @ 106cb3d actually working nondeterministic turing machine simulator Nov 23, 2011
GithubFriends @ 4117c60 housekeeping Jun 21, 2011
HipsterVision @ 1eeddaf housekeeping Jun 21, 2011
HowOld/HowOld new new icon Jan 10, 2011
JusThePics @ c74ddae actually working nondeterministic turing machine simulator Nov 23, 2011
TweetAWakeup working hack Jan 14, 2011
ants ants starter package Oct 20, 2011
d3-tutorial code for the quick d3 tutorial on my blog Sep 28, 2012
for-loops making a simple turing machine Nov 22, 2011
iospeedtest node.js server benchmark Apr 12, 2011
lib process 4sq.com and t.co links properlly, feels a bit hackish tho Aug 23, 2011
node-bitly bundled node-bitly May 22, 2011
node-unshortener @ a3e420b code for the quick d3 tutorial on my blog Sep 28, 2012
nodestagram @ 294b691 housekeeping Jun 21, 2011
poem-generation no idea what has changed Feb 24, 2011
polyglots housekeeping Jun 21, 2011
prefetch_vs_related code for the quick d3 tutorial on my blog Sep 28, 2012
project-euler solved euler 55 Jan 27, 2012
serverbench housekeeping Jun 21, 2011
socket.io-testing socket.io-testing tutorial thingy Nov 30, 2012
test Merge branch 'develop' of github.com:Swizec/node-unshortener into dev… Jun 18, 2011
.gitignore created base for example for tonight's talk May 22, 2012
.gitmodules turing machine in 133 bytes of javascript Nov 27, 2011
99-lisp.clj 99-lisp problem set link Nov 29, 2010
README.md turing machine in 133 bytes of javascript Nov 27, 2011
aho-corasick.hs socket.io-testing tutorial thingy Nov 30, 2012
evolve-text.py 959 generations to get Amor Intellectualis Dec 1, 2010
fibonacci.clj housekeeping Jun 21, 2011
index.js unshortener library spun off into its own project May 18, 2011
machine-140.json forgot to add the turing-140 instructions Nov 28, 2011
machine.json should be working nondeterministic turing machine, but missing unders… Nov 23, 2011
machine2.json forgot a file Dec 7, 2011
package.json Merge pull request #7 from erictj/master Nov 23, 2011
settings.js j.mp API support May 18, 2011
silly-bug.html demo of a quirk Oct 17, 2011
skype-parser.py counter thing Jul 26, 2011
turing-140.js nondeterministic turing machine in 252 characters Dec 7, 2011
turing.js nondeterministic turing machine in 252 characters Dec 7, 2011

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