GNU GPL


The GNU GPL is an
open-source license.
Free Read License

Swizec License


  • Perpetual license (does not expire)
  • Unlimited sites, servers
  • No distribution (hosted use only)
  • Commercial use allowed
  • No support
  • Attribution required
$4.99 Read License

14 Day money-back guarantee

Full refund within 14 days of purchase date.

You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: May 25, 2011
    Last Update: Jun 18, 2011
  • Language: JavaScript
    Platform(s): NodeJS

node-unshortener

node-unshortener
Developed by Swizec Teller, Released May 25, 2011

node-unshortener unshortens any URL on a nodeJS server.

JavaScript

Tags: bit.ly , expand url , goo.gl , is.gd

Short URLs are becoming increasingly prolific on modern social media, but sometimes it's much more appropriate to work with their long versions - for example when matching things to domains.

This library helps you do that. Just throw a URL at it and node-unshortener will tell you what the original URL looks like.

Back to top

Install

Since the component is a npm package installation is pretty simple:

  • download the source
  • cd to directory
  • run "npm install"

Npm should correctly install all dependencies but there is currently a known problem with one of them - node-bitly.

You should follow these additional steps to install the latest version of node-bitly.

  • git clone https://github.com/tanepiper/node-bitly.git
  • cd node-bitly
  • npm link
Back to top

OpenSource

The free version of this library is open source under the GPL and available on github so head over there if you think you can help in making it awesomer or have any bugs to report.

Back to top

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: '',
                             apikey: ''}},
                    function (url) {
                         // url is a url object
                         console.log(url);
                    });
Back to top

Supported domains

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.

Services/domains directly supported so far:

  1. bit.ly
  2. j.mp
  3. is.gd
  4. goo.gl
  5. ericri.es
  6. jc.is
  7. nyti.ms
  8. linkd.in
  9. win.gs
  10. budurl.com
  11. cli.gs
  12. snipurl.com
  13. snurl.com
  14. cl.lk
  15. snipr.com
  16. sn.im
  17. dai.ly
  18. imgry.net
  19. mln.im
  20. theatln.tc
  21. rww.to

User Reviews

No reviews have been submitted yet.

Questions & Comments


Or enter your name and Email
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.