mmmturkeybacon PandA HEAD request

Accepts a HIT with a PandA link by a HEAD request instead of a normal GET request. Add &MTB_HEAD_REQUEST to the end of a PandA URL to run. This is a very bare bones script and gives almost no feedback to the user, so keep an eye on your queue and edit REQUEST_DELAY to suit your needs.

  1. // ==UserScript==
  2. // @name mmmturkeybacon PandA HEAD request
  3. // @version 1.00
  4. // @description Accepts a HIT with a PandA link by a HEAD request instead of a normal GET request. Add &MTB_HEAD_REQUEST to the end of a PandA URL to run. This is a very bare bones script and gives almost no feedback to the user, so keep an eye on your queue and edit REQUEST_DELAY to suit your needs.
  5. // @author mmmturkeybacon
  6. // @namespace http://userscripts.org/users/523367
  7. // @match https://www.mturk.com/mturk/previewandaccept*&MTB_HEAD_REQUEST
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  9. // @grant GM_log
  10. // ==/UserScript==
  11.  
  12.  
  13. var REQUEST_DELAY = 2000; // milliseconds, 1000 milliseconds = 1 seconds
  14. var TIMEOUT_TIME_LIMIT = 10000;
  15.  
  16. $(document).ready(function()
  17. {
  18. function head_request()
  19. {
  20. //console.log(Date.now());
  21. $.ajax({
  22. url: window.location.href,
  23. type: 'HEAD',
  24. success: function(data)
  25. {
  26. //console.log(Date.now());
  27. setTimeout(head_request, REQUEST_DELAY);
  28. },
  29. error: function(xhr, status, error)
  30. {
  31. alert('mmmturkeybacon PandA HEAD request timed out. Reload page to restart.');
  32. },
  33. timeout: TIMEOUT_TIME_LIMIT
  34. });
  35. }
  36.  
  37. head_request();
  38. });