forked from GitHub/dbot
lets try this then
This commit is contained in:
parent
7f9089bc5e
commit
d0ed2eddd1
@ -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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user