3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

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)
};
http.get(options, function(response) {
console.log(response);
dbot.say(data.channel, 'Shortened link from ' + data.user + ': ' + response.surl);
http.get(options, function(res) {
res.setEncoding('utf8');
res.on('data', function (response) {
dbot.say(data.channel, 'Shortened link from ' + data.user + ': ' + JSON.parse(response).surl);
});
});
}
},