GreaterGood CTG AutoClicker

Automatically clicks through all the buttons on all subsites of the GreaterGood ClickToGive program every two hours.

当前为 2021-12-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name GreaterGood CTG AutoClicker
  3.  
  4. // @description Automatically clicks through all the buttons on all subsites of the GreaterGood ClickToGive program every two hours.
  5. // @description:de Klickt sich automatisch alle zwei Std. durch alle Buttons auf allen Seiten des GreaterGood-ClickToGive-Programms.
  6.  
  7. // @version 1.2
  8. // @author Rsge
  9. // @copyright 2021+, Jan G. (Rsge)
  10. // @license Mozilla Public License 2.0
  11. // @icon https://http-aws.greatergood.com/img/ggc/favicon-96x96.png
  12.  
  13. // @namespace https://github.com/Rsge/GreaterGood-CTG-AutoClicker
  14. // @homepageURL https://github.com/Rsge/GreaterGood-CTG-AutoClicker
  15. // @supportURL https://github.com/Rsge/GreaterGood-CTG-AutoClicker/issues
  16.  
  17.  
  18. // @include https://greatergood.com/clicktogive/*
  19. // @include https://*.greatergood.com/clicktogive/*
  20.  
  21. // @grant none
  22. // ==/UserScript==
  23.  
  24. (function () {
  25. 'use strict';
  26.  
  27. const sites = [" Hunger", " Breast Cancer", " Animals", " Veterans", " Autism", " Alzheimer's",
  28. " Diabetes", " Literacy", " Rainforest", " GreaterGood"]
  29.  
  30. // On button site, click button
  31. var i;
  32. var buttons = document.getElementsByTagName("BUTTON");
  33. for (i = 0; i < buttons.length; i++) {
  34. var buttonHTML = buttons[i].innerHTML;
  35. //console.log(buttonHTML);
  36. if (buttonHTML == "Click to Give - it's FREE!") {
  37. buttons[i].click();
  38. return;
  39. }
  40. }
  41.  
  42. // On thanks site, choose new site if not all are already clicked
  43. var divs = document.getElementsByTagName("DIV");
  44. for (i = 0; i < divs.length; i++) {
  45. var divClass = divs[i].className;
  46. //console.log(divClass);
  47. if (divClass.includes("-site col-xs-3 col-sm-4 button-to-count") &&
  48. !divClass.includes("click-more-clickAttempted") &&
  49. sites.includes(divs[i].innerText)) {
  50. var link = divs[i].firstElementChild.href;
  51. //console.log(link);
  52. window.open(link, "_top");
  53. return;
  54. }
  55. }
  56.  
  57. // Wait for 2 h, then reload page to click through again
  58. setTimeout(function(){location.reload(true);}, 7260000);
  59. })();