lets try this then

This commit is contained in:
Luke Slater 2012-04-14 06:26:48 +01:00
parent 7f9089bc5e
commit d0ed2eddd1

View File

@ -17,9 +17,11 @@ var autoshorten = function(dbot) {
'path': '/mkurl?url=' + escape(url) 'path': '/mkurl?url=' + escape(url)
}; };
http.get(options, function(response) { http.get(options, function(res) {
console.log(response); res.setEncoding('utf8');
dbot.say(data.channel, 'Shortened link from ' + data.user + ': ' + response.surl); res.on('data', function (response) {
dbot.say(data.channel, 'Shortened link from ' + data.user + ': ' + JSON.parse(response).surl);
});
}); });
} }
}, },