tailnet.js
Raw
// Set finds to a list of keywords
// finds = ["cat", "gopher"]
let finds = null;
function checkNames() {
if (finds === null) return "honk!";
const names = document.querySelectorAll('[name="tcd-rad"]');
for (let name of names) {
for (let find of finds){
if (name.value.endsWith(`-${find}.ts.net`) || name.value.startsWith(`${find}-`)) return name.value;
}
}
return null;
}
async function nextCat() {
let cat = null;
while (true) {
cat = checkNames();
if (cat !== null) {
if (confirm(cat)) break;
}
optBtn.click();
await new Promise(r => setTimeout(r, 1000));
}
}
1 | // Set finds to a list of keywords |
2 | // finds = ["cat", "gopher"] |
3 | let finds = null; |
4 | |
5 | function checkNames() { |
6 | if (finds === null) return "honk!"; |
7 | const names = document.querySelectorAll('[name="tcd-rad"]'); |
8 | for (let name of names) { |
9 | for (let find of finds){ |
10 | if (name.value.endsWith(`-${find}.ts.net`) || name.value.startsWith(`${find}-`)) return name.value; |
11 | } |
12 | } |
13 | return null; |
14 | } |
15 | |
16 | async function nextCat() { |
17 | let cat = null; |
18 | while (true) { |
19 | cat = checkNames(); |
20 | if (cat !== null) { |
21 | if (confirm(cat)) break; |
22 | } |
23 | optBtn.click(); |
24 | await new Promise(r => setTimeout(r, 1000)); |
25 | } |
26 | } |