QqoneAutoClick

一个QQ空间点赞脚本

  1. // ==UserScript==
  2. // @name QqoneAutoClick
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 一个QQ空间点赞脚本
  6. // @author jgckM
  7. // @match *://user.qzone.qq.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=0.1
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12. (function () {
  13. let style = document.createElement('style');
  14. let body = document.querySelector('body');
  15. style.innerHTML =
  16. '.box{position:fixed;top:200px;left:10px;min-width:100px;max-width:200px;width:auto;padding:10px;display:flex;justify-content:center;align-items:center;box-shadow:none;border-radius:10px;border:1px solid #a0a0a0;background-color:#f7f7f9;transition:left 0.3s cubic-bezier(0.03,0.21,0,1.32)}.box label{font-size:18px}.box input{border:1px solid #a0a0a0;outline:none;min-width:40px;border-radius:5px;max-width:60px}.box button{border-radius:5px;border-width:1px;width:50px}.box .toggle{font-size:14px;text-align:center;position:absolute;right:-20px;width:20px;height:40px;background-color:darkgray;border-radius:5px}';
  17. body.appendChild(style);
  18. })();
  19.  
  20. window.addEventListener('load', function () {
  21. // Removeiframe();
  22. let box = document.createElement('div');
  23. let body = document.querySelector('body');
  24. box.className = 'box';
  25. box.innerHTML = ` <form action="javascript:void(0)">
  26. <label>点赞数量</label>
  27. <input class="clicknum" required type="number" value="100" max="999" />
  28. <button class="start">开始</button>
  29. <label>滚动速度</label>
  30. <input class="speed" required type="number" value="260" max="999" />
  31. /ms
  32. </form>
  33. <div class="toggle">收起</div>`;
  34. body.appendChild(box);
  35.  
  36. // function Removeiframe() {
  37. // let iframes = document.querySelectorAll('iframe');
  38. // iframes.forEach(function (iframe) {
  39. // iframe.remove();
  40. // });
  41. // }
  42.  
  43. let start = document.querySelector('.box .start');
  44. let clicknum = document.querySelector('.box .clicknum');
  45. let toggle = document.querySelector('.box .toggle');
  46. let speed = document.querySelector('.box .speed');
  47. let timer = null;
  48. let flag = true;
  49. start.addEventListener('click', function () {
  50. clearInterval(timer);
  51. if (flag) {
  52. this.innerHTML = '暂停';
  53. timer = window.setInterval(autoClick, speed.value);
  54. flag = false;
  55. } else {
  56. clearInterval(timer);
  57. this.innerHTML = '开始';
  58. flag = true;
  59. }
  60. });
  61. let toggleFlage = true;
  62. toggle.addEventListener('click', function () {
  63. if (toggleFlage) {
  64. this.innerHTML = '展开';
  65. box.style.left = '-220px';
  66. toggleFlage = false;
  67. } else {
  68. box.style.left = '10px';
  69. toggleFlage = true;
  70. this.innerHTML = '收起';
  71. }
  72. });
  73. let y = 0,
  74. x = 0,
  75. index = 0;
  76.  
  77. function autoClick() {
  78. // Removeiframe();
  79. y = y + 5;
  80. let zan = document.getElementsByClassName('item qz_like_btn_v3');
  81. for (let i = 0; i < zan.length; i++) {
  82. if (clicknum.value < index) {
  83. clearInterval(timer);
  84. start.innerHTML = '开始';
  85. alert(`${clicknum.value}个点赞任务已完成`);
  86. index = 0;
  87. break;
  88. }
  89. if (zan[i].attributes[6].value == 'like') {
  90. zan[i].firstChild.click();
  91. console.log(index);
  92. index++;
  93. }
  94. }
  95. window.scrollBy(x, y);
  96. }
  97. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址