Skip to content

Instantly share code, notes, and snippets.

@aniquetahir
Created November 16, 2018 08:29
Show Gist options
  • Save aniquetahir/84a1dbe318b7d61fcf343b2d7c9df51d to your computer and use it in GitHub Desktop.
Save aniquetahir/84a1dbe318b7d61fcf343b2d7c9df51d to your computer and use it in GitHub Desktop.
function upvoteAll(){
let all_elems = document.querySelectorAll('a.vote-up');
let unvoted = [];
all_elems.forEach(e=>unvoted.push(e));
unvoted = unvoted.filter(e=>e.className.indexOf('upvoted')==-1);
if(unvoted.length>0){
unvoted[0].click();
}
}
setInterval(upvoteAll, 1000);
function autoshow(){
let alert = document.querySelectorAll('.alert--realtime');
if(alert.length>0){
setTimeout(()=>alert[0].click(),1000);
}
let buttons = document.querySelectorAll('.realtime-button.reveal');
buttons.forEach(b=>{
setTimeout(()=>b.click(),1000);
});
}
setInterval(autoshow, 1000);
window.addEventListener( 'visibilitychange', evt => evt.stopImmediatePropagation(), true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment