Greasy Fork镜像 支持简体中文。

Qzone AutoLike

网页版QQ空间自动点赞工具

  1. // ==UserScript==
  2. // @name Qzone AutoLike
  3. // @namespace http://tampermonkey.net/
  4. // @license MIT
  5. // @version 0.1
  6. // @description 网页版QQ空间自动点赞工具
  7. // @author Albert Z
  8. // @match *://*.qzone.qq.com/*
  9. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  10. // @grant unsafeWindow
  11. // ==/UserScript==
  12.  
  13. var duration = 180;
  14. var blocked = getCookie('al-blocked').split(','); //3378491536, 2151420951, 1592304225
  15. var dict = ['点赞', '转发', '评论']; // 像极了转发游戏的奇怪词汇
  16. var select = Boolean(getCookie('al-select'));
  17. var nextTime = Date.now();
  18. var isScrolling = false;
  19. var timeout = setTimeout(function() {
  20. isScrolling = false;
  21. }, 100);
  22.  
  23. // 监听scroll事件
  24. window.addEventListener('scroll', function() {
  25. // 将isScrolling标记为true表示页面正在滚动
  26. isScrolling = true;
  27. clearTimeout(timeout);
  28. timeout = setTimeout(function() {
  29. isScrolling = false;
  30. }, 100);
  31. });
  32.  
  33. function setCookie(name, value, iDay) {
  34. var oDate=new Date();
  35. oDate.setDate(oDate.getDate()+iDay);
  36. document.cookie=name+'='+value+';expires='+oDate;
  37. };
  38.  
  39. function getCookie(name) {
  40. var arr=document.cookie.split('; ');
  41. for(var i=0;i<arr.length;i++){
  42. var ars=arr[i].split('=');
  43. if(ars[0]==name) return ars[1];
  44. }
  45. return '';
  46. }
  47.  
  48. function refresh() {
  49. document.querySelector('#feed_friend_refresh').click();
  50. }
  51.  
  52. function like() {
  53. let btns = document.querySelectorAll('.qz_like_btn_v3'); // 所有点赞按钮
  54. let ars = document.querySelectorAll('.f-info'); // 所有文章
  55. let users = document.querySelectorAll('.f-name'); // 所有作者
  56. for (let i=0; i<btns.length; i++) {
  57. if(!btns[i]) continue;
  58. let btn = btns[i];
  59. let ar = ars[i] ? ars[i].innerHTML: '';
  60. let user = users[i] && users[i].getAttribute('link')?
  61. users[i].getAttribute('link').replace('nameCard_', ''): '';
  62. // 先判断是否已点赞或者是屏蔽用户
  63. if (btn.classList.contains('item-on') || blocked.indexOf(user) > -1) continue;
  64. let flag = false;
  65. if (select) {
  66. for (let j=0; j<dict.length; j++) {
  67. let word = dict[j];
  68. if (ar.includes(word)) {
  69. flag = true;
  70. break;
  71. }
  72. }
  73. }
  74. if (flag) continue;
  75. btn.click();
  76. console.log('Liked: ' + ar);
  77. }
  78. }
  79.  
  80. function setConfig() {
  81. let max = Number.MAX_SAFE_INTEGER;
  82. alert("Auto Like 需要您填写一些必要的信息~");
  83. let blk = prompt('请输入你不想点赞的用户的QQ号(可输入多个,用英文逗号","分隔)').replaceAll(' ', '');
  84. blocked = blk.split(',');
  85. setCookie('al-blocked', blk, max);
  86. select = confirm('是否不点赞转发游戏类内容?');
  87. if (select == true) setCookie('al-select', 'true', max);
  88. alert('如果需要再次设置,可以双击页面任意处调用。');
  89. alert('操作说明:\n需保持浏览器窗口打开qqzone好友动态页面状态, \
  90. 每隔3分钟会自动刷新点赞(会在帖子发出后6分钟内点赞完成,除了被屏蔽用户和类似转发游戏的帖子)。\n滑动页面浏览时也会自动点赞。');
  91. setCookie('al-setted', 'true', max);
  92. }
  93.  
  94. unsafeWindow.setConfig = setConfig;
  95. unsafeWindow.getCookie = getCookie;
  96. unsafeWindow.setCookie = setCookie;
  97.  
  98. onload = function () {
  99. if (!getCookie('al-setted')) setConfig();
  100. setInterval( function() {
  101. let time = Date.now();
  102. if (time >= nextTime) {
  103. // 当到达设定时间时执行
  104. like();
  105. refresh();
  106. nextTime += duration * 1000;
  107. } else if (isScrolling) {
  108. like();
  109. }
  110. }, 800);
  111. };
  112.  
  113. ondblclick = function () {
  114. setConfig();
  115. };
  116.  
  117. (function () {
  118. console.log('Auto Link Running...');
  119. })();

QingJ © 2025

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