GNU GPL FREE

The GNU GPL is an
open-source license.
Read full license

Swizec License $4.99

Unlimited sites, servers No source distribution Commercial use allowed Can modify source No support Attribution required Read full license | More Info

You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

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

Starting from FREE

View Pricing 14 days money-back guarantee

node-unshortener

node-unshortener unshortens any URL on a nodeJS server.

Share and win up to $15k in prizes each month!Learn more

Share

Description

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

Questions & Comments

Leave a comment

You must be logged-in to leave a comment.
Log-in now or register for a free account.
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.

User Reviews

No reviews have been submitted yet.

Starting from FREE

View Pricing 14 days money-back guarantee