Skip to content

Instantly share code, notes, and snippets.

@hejmsdz
Last active July 1, 2017 09:56
Show Gist options
  • Save hejmsdz/34d1ed9755ce2bc840372ff02e0371c1 to your computer and use it in GitHub Desktop.
Save hejmsdz/34d1ed9755ce2bc840372ff02e0371c1 to your computer and use it in GitHub Desktop.
Oczekiwanie na wyniki z MP
(function(album) {
var intvl = setInterval(function() {
fetch('Metody_probabilistyczne_-__wiczenia_2016_17.html').then(x => x.text()).then(function(data) {
var dom = new DOMParser().parseFromString(data, "text/html");
document.body.innerHTML = dom.getElementsByTagName('body')[0].innerHTML;
var tr = [].slice.call(dom.querySelectorAll('tr')).filter(tr => tr.firstChild.innerHTML == album)[0].lastChild.innerHTML;
if (tr != ' ') {
clearInterval(intvl);
alert(tr);
} else console.log('jeszcze nie ma');
});
}, 5*60*1000);
})('TU WPISZ SWÓJ NUMER ALBUMU');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment