PT Auto Thanks

Auto thanks in TTG and NexusPHP.

  1. // ==UserScript==
  2. // @id PT_Auto_Thanks@jiayiming
  3. // @name PT Auto Thanks
  4. // @version 1.2
  5. // @namespace jiayiming
  6. // @author jiayiming
  7. // @description Auto thanks in TTG and NexusPHP.
  8. // @include http://ttg.im/t/*/
  9. // @include http://*details.php*
  10. // @run-at document-end
  11. // ==/UserScript==
  12.  
  13.  
  14. (function() {
  15.  
  16. function $(css, contextNode) {
  17. return (contextNode || document).querySelector(css);
  18. }
  19.  
  20. function Thanks() {
  21. var url = location.href;
  22. var btn = '';
  23.  
  24. if (url.indexOf('ttg') > 0) {
  25. btn = $('#ajaxthanks');
  26. } else if (url.indexOf('details') > 0) {
  27. btn = $('#saythanks');
  28. }
  29. if (btn != undefined && btn.disabled != true) {
  30. //alert(url);
  31. //btn.onclick = undefined;
  32. btn.click();
  33. }
  34. }
  35.  
  36. window.addEventListener('load', Thanks(), false);
  37. })();