ZSMTurker's Auto Reload

Automatically starts reloading page when you've missed a HIT.

  1. // ==UserScript==
  2. // @author ZSMTurker
  3. // @name ZSMTurker's Auto Reload
  4. // @namespace https://greasyfork.org/users/2291
  5. // @description Automatically starts reloading page when you've missed a HIT.
  6. // Reloads every 5 seconds if no HITs are available.
  7. // Only works on previewandaccept links
  8. // @include https://www.mturk.com/mturk/previewandaccept*
  9. // @require http://code.jquery.com/jquery-latest.min.js
  10. // @version 0.2
  11. // ==/UserScript==
  12.  
  13. /* UPDATE v0.2 Wait until document loads to wait for CAPTCHAs
  14. * Fix CAPTCHA check */
  15.  
  16. /* Variables that hold alertbox messages */
  17. var checkForNoMore = $( document ).find( '#alertboxHeader:contains(There are no more available)' ).text(),
  18. checkForCAPTCHA = $( document ).find( 'td:contains(In order to accept your next HIT)').text();
  19.  
  20. $( document ).ready( function() {
  21. if ( checkForCAPTCHA ) {
  22. } else if ( checkForNoMore ) {
  23. document.title = 'Fishing For That HIT...';
  24. setTimeout( function() {
  25. location.reload( true );
  26. }, 5000 );
  27. } else {
  28. var requesterName = $( 'tr:contains(Requester)' ).last().children().first().next().text().trim(),
  29. hitName = $( document ).find( 'div div tbody tr td tbody tr td div' ).text().trim();
  30. document.title = 'Got it!!! ' + requesterName + ' ' + hitName;
  31. }
  32. } );