node-unshortener provides a link unshortener module for Node.js.
You can install node-unshortener from the github package. Dependencies:
The unshortener can be used on almost any link shortener service. 'goo.gl', 'dlvr.it', 't.co', 'bit.ly' and 'qr.ae' are supported by default. Read the examples to see its usage.
var u = require('../lib/unshortener'),
unshortener = new u(['youtu.be']);
The above snippet creates a new unshortener object and specifies youtu.be as an extra shortener service (in addition to the others stated above). This (optional) parameter can be a list of arbitrary length containing shortener services.
The following snippet shows an example of the unshortener for the goo.gl shortener service.
unshortener.unshorten('http://goo.gl/FEkwU', function (err, body) {
if (err) {
throw err + ' on url \'' + url + '\'';
return this;
} else {
console.log(body);
}
});
The test directory contains tests for various URLs.
- Philip De Smedt (author)