Skip to content

Instantly share code, notes, and snippets.

@rajeshpv
Last active December 23, 2023 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajeshpv/19727d6a5a035ecfffeae31f031f028c to your computer and use it in GitHub Desktop.
Save rajeshpv/19727d6a5a035ecfffeae31f031f028c to your computer and use it in GitHub Desktop.
dhamma_poll.js
/*
Manually Enable "Autoplay" settings to play audio following steps:
https://support.mozilla.org/en-US/kb/block-autoplay
*/
//test audio wors
function playAudio(){
// let audio = new Audio('https://audio.code.org/winpoint1.mp3');
// audio.play();
console.log('yes playing' + new Date());
}
function checkCount(){
const currentLinkCount = document.querySelectorAll('td.apply > a').length;
if( currentLinkCount > 11) playAudio();
}
function runInLoop(){
window.location.reload(true);
setTimeout(checkCount, 2000);
}
// playAudio();
// checkCount();
// to know current apply links visible
console.log(document.querySelectorAll('td.apply > a').length);
timerObject = setInterval(runInLoop, 5000); // enable-1
// clearInterval(timeObject); // run this to disable poll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment