forked from GitHub/dbot
i am tired
This commit is contained in:
parent
1924d28952
commit
e1833017b0
@ -11,15 +11,15 @@ var autoshorten = function(dbot) {
|
|||||||
if(urlMatches !== null) {
|
if(urlMatches !== null) {
|
||||||
var url = urlMatches[0]; // Only doing one, screw you.
|
var url = urlMatches[0]; // Only doing one, screw you.
|
||||||
|
|
||||||
var site = http.createClient(80, 'nc.no.de');
|
var options = {
|
||||||
var request = site.request("GET", 'mkurl', { 'host' : 'nc.no.de/',
|
'host': 'nc.no.de',
|
||||||
'url': url});
|
'port': 80,
|
||||||
request.end();
|
'path': '/mkurl?url=' + escape(url)
|
||||||
|
};
|
||||||
|
|
||||||
request.on('response', function(response) {
|
http.get(options, function(response) {
|
||||||
dbot.say(data.channel, 'Shortened link from ' + data.user + ': ' + response.surl);
|
dbot.say(data.channel, 'Shortened link from ' + data.user + ': ' + response.surl);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user