diff --git a/modules/link/link.js b/modules/link/link.js index e07c178..fe19117 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -11,7 +11,9 @@ var link = function(dbot) { this.urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; this.links = {}; this.fetchTitle = function(event, link) { - request(link, function(error, response, body) { + var limit = 250 * 1000, + size = 0, + page = request(link, function(error, response, body) { if(!error && response.statusCode == 200) { body = body.replace(/(\r\n|\n\r|\n)/gm, " "); var title = body.valMatch(/(.*)<\/title>/, 2); @@ -20,6 +22,13 @@ var link = function(dbot) { } } }); + + page.on('data', function(chunk) { + size += chunk.length; + if(size > limit) { + page.abort(); + } + }); }; var commands = { diff --git a/modules/spelling/spelling.js b/modules/spelling/spelling.js index 5078e29..cf574c9 100644 --- a/modules/spelling/spelling.js +++ b/modules/spelling/spelling.js @@ -99,6 +99,7 @@ var spelling = function(dbot) { var fix = this.last[event.channel.name][candidate].replace(winner, correction); if (/^.ACTION/.test(fix)) { fix = fix.replace(/^.ACTION/, '/me'); + fix = fix.replace("\x01", ''); } this.last[event.channel.name][candidate] = fix; var output = { diff --git a/modules/spotify/strings.json b/modules/spotify/strings.json index 9899843..bb50931 100644 --- a/modules/spotify/strings.json +++ b/modules/spotify/strings.json @@ -1,18 +1,18 @@ { "artist": { - "english": "{s} [artist] {artist}" + "en": "{s} [artist] {artist}" }, "album": { - "english": "{s} [album] {artist} – {album}" + "en": "{s} [album] {artist} – {album}" }, "track": { - "english": "{s} [track] {artist} – {track} (from {album})" + "en": "{s} [track] {artist} – {track} (from {album})" }, "found": { - "english": "{s} [{url}] {artist} – {track} (from {album})" + "en": "{s} [{url}] {artist} – {track} (from {album})" }, "not-found": { - "english": "{s} No results.", + "en": "{s} No results.", "na'vi": "{s}, Oel ke tsun rivum ayuoti." } } diff --git a/views/quotes/error.jade b/views/quotes/error.jade new file mode 100644 index 0000000..f78f6ae --- /dev/null +++ b/views/quotes/error.jade @@ -0,0 +1 @@ +p #{message}