GreasyFork Total Scripts(modified)

Shows a user's total scripts count on GreasyFork(modified).

As of 2021-12-20. See the latest version.

  1. // ==UserScript==
  2. // @name GreasyFork Total Scripts(modified)
  3. // @namespace pxgamer
  4. // @version 0.2.3
  5. // @description Shows a user's total scripts count on GreasyFork(modified).
  6. // @author NotYou
  7. // @include *greatest.deepsurf.us/*/users/*
  8. // @require https://code.jquery.com/jquery-1.7.2.min.js
  9. // @license GPLv3
  10. // @license-link https://www.gnu.org/licenses/gpl-3.0.txt
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. /* What's New?:
  15. * - All languagees support (https://greatest.deepsurf.us/en/scripts/20343-greasyfork-total-scripts/discussions/15913)
  16. * - Displaying near "Scripts"
  17. * - Colours change parallel to the number count
  18. * - jQuery bug fix
  19. */
  20.  
  21. (function() {
  22. 'use strict';
  23.  
  24. let l = $('li[data-script-id]').length;
  25. if (l == 1) {
  26. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(191, 191, 191);font-variant: normal;"> [' + l + ' Total Script]</span>');
  27. }
  28. else if(l >= 100) {
  29. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 16, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  30. }
  31. else if(l >= 50) {
  32. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 87, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  33. }
  34. else if(l >= 25) {
  35. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(185, 159, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  36. }
  37. else if(l >= 10) {
  38. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(21, 185, 16);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  39. }
  40. else if(l >= 5) {
  41. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 185, 153);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  42. }
  43. else if(l > 1) {
  44. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(16, 42, 185);font-variant: normal;"> [' + l + ' Total Scripts]</span>');
  45. }
  46. else {
  47. $('div.sidebarred-main-content h3:first').append('<span style="font-size: 15px;color: rgb(213, 79, 79);font-variant: normal;"> [ Unexpected error! ]</span>');
  48. }
  49. })();