Kick Auto Click "Show More"

This script automatically clicks the "Show More" button twice on the sidebar, on kick.com.

目前为 2024-09-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Kick Auto Click "Show More"
  3. // @namespace Violentmonkey Scripts
  4. // @match *://*.kick.com/*
  5. // @grant none
  6. // @version 2.4
  7. // @license MIT
  8. // @icon
  9. // @author Trilla_G
  10. // @description This script automatically clicks the "Show More" button twice on the sidebar, on kick.com.
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. let clickCount = 0;
  17. const maxClicks = 2;
  18.  
  19. function clickShowMore() {
  20. // Updated selector
  21. const showMoreButton = document.querySelector('div.mx-3:nth-child(2) > button:nth-child(1) > span:nth-child(2)');
  22.  
  23. if (showMoreButton) {
  24. const clickEvent = new MouseEvent('click', {
  25. bubbles: true,
  26. cancelable: true,
  27. view: window
  28. });
  29. showMoreButton.dispatchEvent(clickEvent);
  30. clickCount++;
  31. console.log(`Clicked 'Show More' button ${clickCount} time(s)`);
  32. if (clickCount >= maxClicks) {
  33. clearInterval(clickInterval);
  34. }
  35. } else {
  36. console.log("'Show More' button not found");
  37. }
  38. }
  39.  
  40. const clickInterval = setInterval(() => {
  41. if (clickCount < maxClicks) {
  42. clickShowMore();
  43. } else {
  44. clearInterval(clickInterval);
  45. }
  46. }, 1000); // Try every second until the button is clicked twice
  47. })();