Optimize kym search

This commit is contained in:
Daniel Odendahl Jr
2018-10-05 15:12:11 +00:00
parent 66b2d2ef67
commit cb68c978a5
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -67,13 +67,13 @@ module.exports = class KnowYourMemeCommand extends Command {
getMemeDescription($) { getMemeDescription($) {
const children = $('.bodycopy').first().children(); const children = $('.bodycopy').first().children();
let foundAbout = false;
for (let i = 0; i < children.length; i++) { for (let i = 0; i < children.length; i++) {
const child = children.eq(i); const text = children.eq(i).text();
if (child.text() === 'About') { if (foundAbout) {
for (let j = i + 1; j < children.length; j++) { if (text) return text;
const text = children.eq(j).text(); } else if (foundAbout) {
if (text) return text; foundAbout = true;
}
} }
} }
return null; return null;
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "92.2.5", "version": "92.2.6",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {