Created
September 16, 2020 14:42
-
-
Save stanley2058/49d6b76e7f24fa8ebe57a51382f23f01 to your computer and use it in GitHub Desktop.
AREE Answering Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste into console and hit enter | |
fetch('https://raw.githubusercontent.com/jimting/AREEAnswer/master/answer.json').then(res => res.json()).then(res => { | |
const data = res; | |
const optionList = [...document.querySelectorAll('.nobgcl')]; | |
[...document.querySelectorAll('table p')].forEach((p, i) => { | |
const result = data.filter(d => d.name.includes(p.innerText)); | |
if (result.length > 0) { | |
const opt = result[0].options.filter(o => o.toLocaleLowerCase().includes('v'))[0]; | |
if (opt) { | |
const ans = opt.substr(opt.indexOf(')') + 1); | |
const options = [...optionList[i].querySelectorAll('td')]; | |
for (let i = 0; i < options.length; ++i) { | |
const td = options[i]; | |
if (td.innerText && td.innerText.includes(ans)) { | |
options[i - 1].querySelector('input').click(); | |
break; | |
} | |
} | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment