3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00

dont bother with titles if they are too long

This commit is contained in:
reality 2013-02-20 10:28:47 +00:00
parent e648068b1c
commit 57977ac182

View File

@ -14,7 +14,7 @@ var link = function(dbot) {
if(!error && response.statusCode == 200) { if(!error && response.statusCode == 200) {
body = body.replace(/(\r\n|\n\r|\n)/gm, " "); 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 && title.length < 140) {
event.reply(title[1]); event.reply(title[1]);
} }
} }