Comparing version 1.1.2 to 1.1.3
15
index.js
@@ -5,11 +5,16 @@ var request = require('request'); | ||
shorten: function(url, cb) { | ||
request('http://v.gd/create.php?format=simple&url=' + url, function (error, response, body) { | ||
cb(body.split("\n")[0]); | ||
request('http://v.gd/create.php?format=simple&url=' + encodeURIComponent(url), function (error, response, body) { | ||
cb(body.split("\n")[0]); | ||
}); | ||
}, | ||
custom: function(url, text, cb) { | ||
request('http://v.gd/create.php?format=simple&url=' + encodeURIComponent(url) + '&shorturl=' + encodeURIComponent(text), function (error, response, body) { | ||
cb(body.split("\n")[0]); | ||
}); | ||
}, | ||
lookup: function(url, cb) { | ||
request('http://v.gd/forward.php?format=simple&shorturl=' + url, function (error, response, body) { | ||
cb(body.split("\n")[0]); | ||
request('http://v.gd/forward.php?format=simple&shorturl=' + encodeURIComponent(url), function (error, response, body) { | ||
cb(body.split("\n")[0]); | ||
}); | ||
} | ||
}; | ||
}; |
@@ -0,0 +0,0 @@ GNU GENERAL PUBLIC LICENSE |
{ | ||
"name": "vgd", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "http://v.gd URL Shortener Node.js Module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,6 @@ [![NPM](https://nodei.co/npm/vgd.png?downloads=true&downloadRank=true&stars=true)](https://npmjs.com/package/vgd/) | ||
vgd.custom('http://google.com', 'MyGoogleShortcut', function(res) { | ||
console.log(res); // If the custom URL of MyGoogleShortcut is actually available, it should return http://v.gd/MyGoogleShortcut | ||
}); | ||
vgd.lookup('http://v.gd/ddwyMm', function(res) { | ||
@@ -23,2 +27,2 @@ console.log(res); //Returns a longer version of http://v.gd/ddwyMm - http://google.com | ||
[This Package Is Under The GPL-3.0 License](https://raw.githubusercontent.com/AlphaT3ch/v.gd/master/LICENSE.txt) | ||
[This Package Is Under The GPL-3.0 License](https://raw.githubusercontent.com/AlphaT3ch/v.gd/master/LICENSE.txt) |
18
27
37291