Skip to content

Instantly share code, notes, and snippets.

@lempiy
Last active April 21, 2019 20:51
Show Gist options
  • Save lempiy/3b96646942285583a5c92b67a558c73c to your computer and use it in GitHub Desktop.
Save lempiy/3b96646942285583a5c92b67a558c73c to your computer and use it in GitHub Desktop.
(()=> {
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