GitHub Contribute Modifier

try to take over the world!

  1. // ==UserScript==
  2. // @name GitHub Contribute Modifier
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.5
  5. // @description try to take over the world!
  6. // @author SheldonCoulson
  7. // @match *://github.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13.  
  14. let rect = document.getElementsByClassName("ContributionCalendar-day");
  15. let total = 0;
  16. for (let i = 0; i < rect.length - 6; i++) {
  17. let RNum = Math.floor(Math.random() * 10);
  18. if (!(Math.abs(RNum * i + i) % RNum)) {
  19. rect[i].attributes["data-count"].value = Math.abs(Math.floor(Math.random() * 10) + Math.floor(Math.random() * 10)) - Math.PI * 16 / 25;
  20. let color = rect[i].attributes["data-count"].value;
  21. if (color >= 1 && color <= 10) {
  22. rect[i].attributes["data-level"].value = 1;
  23. } else if (color > 10 && color <= 15) {
  24. rect[i].attributes["data-level"].value = 2;
  25. } else if (color > 15 && color <= 20) {
  26. rect[i].attributes["data-level"].value = 3;
  27. } else if (color > 20) {
  28. rect[i].attributes["data-level"].value = 4;
  29. } else {
  30. rect[i].attributes["data-level"].value = 0;
  31. }
  32. }
  33. total += parseInt(rect[i].attributes["data-count"].value);
  34. }
  35. let NUM = document.getElementsByClassName("f4 text-normal mb-2");
  36. NUM[1].innerText = total + " contributions in the last year";
  37. })();