Mturk ID Copy/Paste

For Amazon Mechanical Turk (Mturk). Places an unobtrusive button on survey pages which provides quick access to copy your mTurk worker ID by copy and paste or drag and drop. This is the UPDATED version of Tjololo's earlier work.

当前为 2015-08-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Mturk ID Copy/Paste
  3. // @author Swole_hamster
  4. // @license Simplified BSD license
  5. // @icon http://icons.iconarchive.com/icons/flameia/rabbit-xp/32/documents-icon.png
  6. // @version 2.87
  7. // @namespace http://www.mturkforum.com
  8. // @description For Amazon Mechanical Turk (Mturk). Places an unobtrusive button on survey pages which provides quick access to copy your mTurk worker ID by copy and paste or drag and drop. This is the UPDATED version of Tjololo's earlier work.
  9. // @include https://www.mturk.com/mturk/dashboard
  10. // @include http://*.qualtrics.com/*
  11. // @include https://*.qualtrics.com/*
  12. // @include https://*.*.qualtrics.com/*
  13. // @include http://*.*.qualtrics.com/*
  14. // @include http://*.surveygizmo.com/*
  15. // @include https://*.surveygizmo.com/*
  16. // @include https://docs.google.com/forms/*
  17. // @include https://*.surveymonkey.com/*
  18. // @include https://*.vennliapp.com/*
  19. // @include https://*.*.*.de/*
  20. // @include http://*.*.*.de/*
  21. // @include https://*.*.de/*
  22. // @include http://*.*.de/*
  23. // @include https://*.de/*
  24. // @include http://*.de/*
  25. // @include http://*.*.*.edu/*
  26. // @include https://*.*.*.edu/*
  27. // @include http://*.*.edu/*
  28. // @include https://*.*.edu/*
  29. // @include http://*.*.*.ca/*
  30. // @include https://*.*.*.ca/*
  31. // @include http://*.*.ca/*
  32. // @include https://*.*.ca/*
  33. // @include http://www.marshlabduke.com/*
  34. // @include https://*.typeform.com/*
  35. // @include http://surveys*.surveyanalytics.com/*
  36. // @include http://*.cspurdue.com/*
  37. // @include http://questionpro.com/*
  38. // @include https://questionpro.com/*
  39. // @include https://*.kwiksurveys.com/*
  40. // @include https://*.wonderliconline.com/*
  41. // @include http://*.lab42.com/*
  42. // @include http://turkitron.com/*
  43. // @include http://www.bbk.ac.uk/psychology/*
  44. // @include http://sgiz.mobi/*
  45. // @include http://www.consumerbehaviorlab.com/*
  46. // @include https://www.psychdata.com/*
  47. // @include https://www.isurvey.soton.ac.uk/*
  48. // @include http://survey.psy.unipd.it/*
  49. // @include https://www.predikkta.com/*
  50. // @include https://*.userzoom.com/*
  51. // @include https://www.vopspsy.ugent.be/*
  52. // @include http://crsi.byethost33.com/*
  53. // @include https://www.psychdata.com/*
  54. // @include http://hospitalityexperiments.net/*
  55. // @include http://www.dise-online.net/*
  56. // @include https://www.descil.ethz.ch/apps/mturk/*
  57. // @include https://survey.ulb.ac.be/limesurvey/*
  58. // @include https://www.tfaforms.com/*
  59. // @include http://pcmle.rhul.ac.uk/experiment1/*
  60. // @include https://*.shinyapps.io/*
  61. // @include https://mutual-science.org/*
  62. // @include http://*/TurkGate/*
  63. // @include http://jbfreeman.net/webmt/*
  64. // @include http://*.fluidsurveys.com/*
  65. // @include https://gate.aon.com/*
  66. // @include https://www.cvent.com/Surveys/*
  67. // @include http://*/limesurvey/*
  68. // @grant GM_setValue
  69. // @grant GM_getValue
  70. // @grant GM_registerMenuCommand
  71. // ==/UserScript==
  72.  
  73. $ = unsafeWindow.$;
  74.  
  75.  
  76. workerID = GM_getValue("workerID");
  77. if(!workerID || workerID === "") {
  78. if (window.location.href == "https://www.mturk.com/mturk/dashboard") {
  79. workerIDNode = document.evaluate("//span[@class='orange_text_right']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
  80. for (i=0; i<workerIDNode.snapshotLength; i++) {
  81. nd = workerIDNode.snapshotItem(i);
  82. idstring = nd.innerHTML;
  83. workerID = idstring.split(': ')[1];
  84. GM_setValue("workerID",workerID);
  85. }
  86. } else {
  87. workerID="";
  88. GM_setValue("workerID","");
  89. }
  90. } else {
  91. if (!/https?:\/\/www.mturk.com\/mturk\/*/.test(window.location.href)) {
  92. idDiv = document.createElement('div');
  93. idDiv.id = "workerIDDiv";
  94. idInner = "<input type='text' onmouseover='javascript:this.focus();this.select() ;' onmouseout='javascript:this.blur();' value='" + workerID + "' style='position:fixed;border:thick solid #010101;top:20px;z-index:10000;right:1px;padding:5px 3px;background:#560E49;font-size:14px;color:white;' readonly/>";
  95. idDiv.innerHTML = idInner;
  96. document.body.insertBefore(idDiv,document.body.firstChild);
  97. }
  98. }