Last active
April 21, 2019 20:51
-
-
Save lempiy/3b96646942285583a5c92b67a558c73c to your computer and use it in GitHub Desktop.
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
(()=> { | |
const submit = document.querySelector('#search-frm button[type="submit"]') | |
const utterThis = new SpeechSynthesisUtterance('Found ticket'); | |
const id = setInterval(() => { | |
const table = document.querySelector('#train-list .train-table') | |
if (!table) { | |
submit.click() | |
return | |
} | |
console.log(table) | |
const rows = table.querySelectorAll('tr.no-place') | |
if (rows.length != 5) { | |
window.speechSynthesis.speak(utterThis) | |
clearInterval(id) | |
return | |
} | |
submit.click() | |
}, 1000) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment