node-unshortener

Released 4 years ago , Last update 4 years ago

node-unshortener unshortens any URL on a nodeJS server.

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.

Pricing

FREE

GNU GPL

The GNU GPL is an open-source license.

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

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.

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

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
2 licenses, starting from From » FREE View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


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