HIT Scraper Ghost

Now hits hang around foreeeever.

目前為 2017-02-26 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name HIT Scraper Ghost
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Now hits hang around foreeeever.
  6. // @author You
  7. // @match https://www.mturk.com/mturk/findhits*hit_scraper
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. // Load the script
  13. var script = document.createElement("SCRIPT");
  14. script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
  15. script.type = 'text/javascript';
  16. script.onload = function() {
  17. var $ = window.jQuery;
  18. // Create new results...
  19. $('body').append("<table id='ghost'></table>");
  20.  
  21. function update() {
  22. console.log('Only triggered once');
  23. var newElements = $('tr.shine:not(.ignored):not(blocklisted)').clone().prependTo('#ghost');
  24. $('#ghost tr').slice(16).remove();
  25. }
  26. var triggerTimer;
  27. function triggerUpdate() {
  28. console.log('triggerd');
  29. clearTimeout(triggerTimer);
  30. // create timer function
  31. triggerTimer = setTimeout(update,100);
  32. }
  33. $('#resultsTable').on('DOMNodeInserted DOMNodeRemoved webkitTransitionEnd input', function() {
  34. triggerUpdate();
  35. // Get elements.
  36. });
  37. };
  38. document.getElementsByTagName("head")[0].appendChild(script);
  39. })();