Guest User

Untitled

a guest
Nov 16th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. function upvoteAll(){
  2. let all_elems = document.querySelectorAll('a.vote-up');
  3. let unvoted = [];
  4. all_elems.forEach(e=>unvoted.push(e));
  5. unvoted = unvoted.filter(e=>e.className.indexOf('upvoted')==-1);
  6. if(unvoted.length>0){
  7. unvoted[0].click();
  8. }
  9. }
  10. setInterval(upvoteAll, 1000);
  11.  
  12. function autoshow(){
  13. let alert = document.querySelectorAll('.alert--realtime');
  14. if(alert.length>0){
  15. setTimeout(()=>alert[0].click(),1000);
  16. }
  17.  
  18. let buttons = document.querySelectorAll('.realtime-button.reveal');
  19. buttons.forEach(b=>{
  20. setTimeout(()=>b.click(),1000);
  21. });
  22. }
  23. setInterval(autoshow, 1000);
  24.  
  25. window.addEventListener( 'visibilitychange', evt => evt.stopImmediatePropagation(), true);
Add Comment
Please, Sign In to add comment