3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-28 13:42:36 +01:00

Merge pull request #561 from kabniel/patch-1

Update link.js
This commit is contained in:
Luke Slater 2013-08-21 10:37:54 -07:00
commit 15d5c1ce16

View File

@ -27,7 +27,7 @@ var link = function(dbot) {
page = request(link.replace('https', 'http'), function(error, response, body) {
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 && title.length < 140) {
callback(ent.decode(title[1]).trim());
}