Merge branch 'master' of github.com:reality/depressionbot

This commit is contained in:
Luke Slater 2012-06-05 00:17:58 +01:00
commit 9813ced30f

View File

@ -20,6 +20,7 @@ var link = function(dbot) {
request(link, function (error, response, body) { request(link, function (error, response, body) {
if(!error && response.statusCode == 200) { if(!error && response.statusCode == 200) {
body = body.replace(/(\r\n|\n\r|\n)/gm, " ");
var title = body.valMatch(/<title>(.*)<\/title>/, 2); var title = body.valMatch(/<title>(.*)<\/title>/, 2);
if(title) { if(title) {
event.reply(title[1]); event.reply(title[1]);