HF Poll Counter

Counts polls properly when they are public (or mod of the section)

  1. // ==UserScript==
  2. // @name HF Poll Counter
  3. // @namespace Xerotic
  4. // @description Counts polls properly when they are public (or mod of the section)
  5. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
  6. // @include **hackforums.net/polls.php**
  7. // @run-at document-end
  8. // @version 1.1
  9. // ==/UserScript==
  10.  
  11. var total_count = 0;
  12.  
  13. $('.quick_keys').first().find('tr').each(function() {
  14. if(!$(this).children().first().hasClass('thread')) {
  15. if($(this).children().first().hasClass('tfoot')) {
  16. $(this).children().first().next().html('<strong>' + total_count + ' votes</strong>');
  17. } else {
  18. $(this).children().first().next().next().html($(this).children().first().next().find('a').length);
  19. total_count += parseInt($(this).children().first().next().find('a').length);
  20. }
  21. }
  22. });