AJ Ghergich Helper (MTurk)

A simple helper script for AJ Ghergich email HITs on MTurk (Mechanical Turk). It linkifies the URL, automatically focuses on the email input box and makes it easier to select the "Not found" button.

  1. // ==UserScript==
  2. // @name AJ Ghergich Helper (MTurk)
  3. // @description A simple helper script for AJ Ghergich email HITs on MTurk (Mechanical Turk). It linkifies the URL, automatically focuses on the email input box and makes it easier to select the "Not found" button.
  4. // @namespace https://greasyfork.org/users/3408
  5. // @author DonovanM
  6. // @include https://s3.amazonaws.com/mturk_bulk/hits*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
  8. // @version 0.9.1
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. window.addEventListener("load", checkAJ, false);
  13.  
  14. function checkAJ() {
  15. if (document.getElementsByTagName("h3")[0].innerHTML.indexOf("Find The Email Address For The URL Below") !== -1)
  16. main();
  17. }
  18.  
  19. function main() {
  20. $("table").css({ 'border-width': "0", 'border-spacing': "0", 'border-collapse': "collapse" });
  21. $("td").css({ 'border': "0", 'padding': "2px" });
  22.  
  23. var url = $("#mturk_form > p:nth-child(4) > b:nth-child(1)");
  24. var parent = url.parent();
  25. var textBox = $("#Q1Url");
  26. var cantFind = $("#mturk_form > table:nth-child(6) > tbody:nth-child(1) > tr:nth-child(3)");
  27. var radios = $("input:radio");
  28.  
  29. $("#submitButton").css({'width': "100%", 'height': "40px"});
  30.  
  31. url.remove();
  32.  
  33. link = $("<a>");
  34.  
  35. if (url.text().indexOf("http") == -1) {
  36. link.attr('href', "http://" + url.text())
  37. } else {
  38. link.attr('href', url.text())
  39. }
  40.  
  41. link.text(url.text()).attr('target', "_blank");
  42.  
  43. url = link;
  44. url.click(function() { textBox.focus() });
  45.  
  46. cantFind
  47. .css('height', "40px")
  48. .click(function() { radios.eq(0).prop('checked', true) })
  49. .hover(
  50. function() { $("td", this).css("background-color" , "#cef")},
  51. function() { $("td", this).css("background-color" , "white")}
  52. );
  53. cantFind.css('cursor', "pointer");
  54. parent.append(url);
  55. }