From e1833017b05a64e0a8e5bd741cdbd18d9ed99c31 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Sat, 14 Apr 2012 06:21:38 +0100 Subject: [PATCH] i am tired --- modules/autoshorten.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/autoshorten.js b/modules/autoshorten.js index 6af1a8b..1458cb5 100644 --- a/modules/autoshorten.js +++ b/modules/autoshorten.js @@ -10,16 +10,16 @@ var autoshorten = function(dbot) { if(urlMatches !== null) { var url = urlMatches[0]; // Only doing one, screw you. + + var options = { + 'host': 'nc.no.de', + 'port': 80, + 'path': '/mkurl?url=' + escape(url) + }; - var site = http.createClient(80, 'nc.no.de'); - var request = site.request("GET", 'mkurl', { 'host' : 'nc.no.de/', - 'url': url}); - request.end(); - - request.on('response', function(response) { + http.get(options, function(response) { dbot.say(data.channel, 'Shortened link from ' + data.user + ': ' + response.surl); }); - } },