node-unshortener

node-unshortener unshortens any URL on a nodeJS server.

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

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.

Hide

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
Hide

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.

Hide

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

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
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.

X

Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

2 licenses, starting from From » FREE 14 day money-back guarantee View Licenses
or Get a quote

for customization or integration services

Post a comment

Or enter your name and Email
No comments have been posted yet.