forked from GitHub/dbot
redirects
This commit is contained in:
parent
a14d042be2
commit
e120869bcd
@ -25,6 +25,7 @@ var wikipedia = function(dbot) {
|
|||||||
|
|
||||||
body = body[prop].revisions[0]['*'];
|
body = body[prop].revisions[0]['*'];
|
||||||
var oBody = body;
|
var oBody = body;
|
||||||
|
console.log(body);
|
||||||
|
|
||||||
var redirect = body.match(/#redirect \[\[(.+)\]\]/i);
|
var redirect = body.match(/#redirect \[\[(.+)\]\]/i);
|
||||||
if(redirect) {
|
if(redirect) {
|
||||||
@ -49,7 +50,7 @@ var wikipedia = function(dbot) {
|
|||||||
|
|
||||||
body = _.filter(body, function(line) {
|
body = _.filter(body, function(line) {
|
||||||
var spaces = line.match(/\s/g);
|
var spaces = line.match(/\s/g);
|
||||||
return line != '' && !line.match(/^\s+$/) && !line.match(/^!/) && !line.match(/^Category:/) && !line.match(/http:\/\//) && !line.match(/\|/) && !line.match(/:$/) && spaces && spaces.length > 10 && spaces.length < 60;
|
return line != '' && !line.match(/{|}/) && !line.match(/'''/) && !line.match(/^\s+$/) && !line.match(/^!/) && !line.match(/^Category:/) && !line.match(/http:\/\//) && !line.match(/\|/) && !line.match(/:$/) && spaces && spaces.length > 10 && spaces.length < 60;
|
||||||
});
|
});
|
||||||
|
|
||||||
var sentence = body[_.random(0, body.length -1)];
|
var sentence = body[_.random(0, body.length -1)];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user