Auto-Load Vote Counts

Automatically loads SE vote counts if user holds that privilege

  1. // ==UserScript==
  2. // @name Auto-Load Vote Counts
  3. // @author AstroCB
  4. // @description Automatically loads SE vote counts if user holds that privilege
  5. // @version 1.0
  6. // @namespace https://github.com/AstroCB
  7. // @include http://*.stackexchange.com/questions/*
  8. // @include http://stackoverflow.com/questions/*
  9. // @include http://meta.stackoverflow.com/questions/*
  10. // @include http://serverfault.com/questions/*
  11. // @include http://meta.serverfault.com/questions/*
  12. // @include http://superuser.com/questions/*
  13. // @include http://meta.superuser.com/questions/*
  14. // @include http://askubuntu.com/questions/*
  15. // @include http://meta.askubuntu.com/questions/*
  16. // @include http://stackapps.com/questions/*
  17. // @include http://*.stackexchange.com/posts/*
  18. // @include http://stackoverflow.com/posts/*
  19. // @include http://meta.stackoverflow.com/posts/*
  20. // @include http://serverfault.com/posts/*
  21. // @include http://meta.serverfault.com/posts/*
  22. // @include http://superuser.com/posts/*
  23. // @include http://meta.superuser.com/posts/*
  24. // @include http://askubuntu.com/posts/*
  25. // @include http://meta.askubuntu.com/posts/*
  26. // @include http://stackapps.com/posts/*
  27. // @exclude http://*.stackexchange.com/questions/tagged/*
  28. // @exclude http://stackoverflow.com/questions/tagged/*
  29. // @exclude http://meta.stackoverflow.com/questions/tagged/*
  30. // @exclude http://serverfault.com/questions/tagged/*
  31. // @exclude http://meta.serverfault.com/questions/*
  32. // @exclude http://superuser.com/questions/tagged/*
  33. // @exclude http://meta.superuser.com/questions/tagged/*
  34. // @exclude http://askubuntu.com/questions/tagged/*
  35. // @exclude http://meta.askubuntu.com/questions/tagged/*
  36. // @exclude http://stackapps.com/questions/tagged/*
  37. // ==/UserScript==
  38. var x = 0;
  39.  
  40. function loadVotes() {
  41. if (document.getElementsByClassName("vote-count-post")) {
  42. if (x < document.getElementsByClassName("vote-count-post").length) {
  43. document.getElementsByClassName("vote-count-post")[x].click();
  44. x++;
  45. } else {
  46. clearInterval(interval);
  47. }
  48. }
  49. }
  50.  
  51. var interval = setInterval(loadVotes, 1050); // Technically, they can be loaded every second, but this is just to be safe