🚀司机社论坛自动签到-懒人必备🚀

在任何网页下完成sijishes论坛自动签到, 使用了tampermonkey进行跨域请求, 弹出提示请选择"总是允许域名"

  1. // ==UserScript==
  2. // @name 🚀司机社论坛自动签到-懒人必备🚀
  3. // @namespace https://gf.qytechs.cn/zh-CN/scripts/498242-%E5%8F%B8%E6%9C%BA%E7%A4%BE%E8%AE%BA%E5%9D%9B%E8%87%AA%E5%8A%A8%E7%AD%BE%E5%88%B0-%E6%87%92%E4%BA%BA%E5%BF%85%E5%A4%87
  4. // @version 1.4.4
  5. // @description 在任何网页下完成sijishes论坛自动签到, 使用了tampermonkey进行跨域请求, 弹出提示请选择"总是允许域名"
  6. // @require https://cdn.jsdelivr.net/npm/sweetalert2@9
  7. // @author 皮皮鸡
  8. // @match http://*/*
  9. // @match https://*/*
  10. // @grant GM_xmlhttpRequest
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // @grant GM_openInTab
  14. // @license MIT
  15. // @noframes
  16. // ==/UserScript==
  17.  
  18. /* global Swal */
  19.  
  20. const domains = [
  21. "https://sjs47.me",
  22. "https://sijishecn.cc",
  23. "https://sijishex.cc",
  24. "https://sijishe.ink",
  25. "https://xsijishe.net"
  26. ];
  27.  
  28. const checkNewDay = (ts) => {
  29. const t = new Date(ts);
  30. t.setMinutes(t.getMinutes());
  31. t.setHours(0, 0, 0, 0);
  32. const d = new Date();
  33. d.setMinutes(t.getMinutes());
  34. return (d - t > 86400e3);
  35. };
  36.  
  37. const sign = () => {
  38. if (GM_getValue("notified")) {
  39. trySign(0);
  40. } else {
  41. Swal.fire({
  42. text: '由于脚本使用了tampermonkey进行跨域请求, 弹出提示请选择"总是允许域名"',
  43. confirmButtonText: '确定'
  44. }).then(() => {
  45. GM_setValue("notified", true);
  46. trySign(0);
  47. });
  48. }
  49. };
  50.  
  51. const trySign = (index) => {
  52. if (index >= domains.length) {
  53. Swal.fire({
  54. icon: 'error',
  55. title: 'sijishes论坛自动签到',
  56. text: '所有域名均无法访问,请获取最新域名地址。',
  57. showCancelButton: true,
  58. cancelButtonText: '今日不再尝试签到',
  59. confirmButtonText: '重新尝试',
  60. }).then(result => {
  61. if (result.isConfirmed) {
  62. trySign(0); // 重新从第一个域名尝试
  63. } else {
  64. GM_setValue("ts", Date.now()); // 设置已处理日期,防止重复提示
  65. console.log('今日不再尝试签到');
  66. }
  67. });
  68. return;
  69. }
  70.  
  71. // 获取 formhash
  72. GM_xmlhttpRequest({
  73. method: "GET",
  74. url: `${domains[index]}/plugin.php?id=k_misign:sign`,
  75. timeout: 10e3,
  76. onload: response => {
  77. const formhashMatch = response.responseText.match(/name="formhash" value="([a-zA-Z0-9]+)"/);
  78. if (formhashMatch) {
  79. const formhash = formhashMatch[1];
  80. sendRequest(index, formhash);
  81. } else {
  82. // 如果未找到 formhash,尝试下一个域名
  83. trySign(index + 1);
  84. }
  85. },
  86. onerror: function () {
  87. trySign(index + 1);
  88. }
  89. });
  90. };
  91.  
  92. const sendRequest = (index, formhash) => {
  93. GM_xmlhttpRequest({
  94. method: "GET",
  95. url: `${domains[index]}/plugin.php?id=k_misign:sign&operation=qiandao&formhash=${formhash}&format=empty`,
  96. timeout: 10e3,
  97. onload: response => {
  98. response = response.responseText;
  99. if (response.match("签到成功") !== null) {
  100. Swal.fire({
  101. icon: 'success',
  102. title: 'sijishes论坛自动签到',
  103. html: `<strong>成功!</strong>`
  104. });
  105. GM_setValue("ts", Date.now());
  106. } else if (response.match("今日已签") !== null) {
  107. Swal.fire({
  108. icon: 'warning',
  109. title: 'sijishes论坛自动签到',
  110. text: '您已经签到过了!'
  111. });
  112. GM_setValue("ts", Date.now());
  113. } else if (response.match("请先登录(不可用)") !== null) {
  114. Swal.fire({
  115. icon: 'error',
  116. title: 'sijishes论坛自动签到',
  117. text: '您需要先登录(不可用)才能继续本操作!'
  118. });
  119. } else if (response.match("Discuz! System Error") !== null) {
  120. Swal.fire({
  121. icon: 'error',
  122. title: 'sijishes论坛自动签到',
  123. text: '请求包含非法字符,已被系统拒绝。'
  124. });
  125. } else {
  126. console.log(response);
  127. Swal.fire({
  128. icon: 'error',
  129. title: 'sijishes论坛自动签到',
  130. text: '未知返回信息❗ 请打开控制台查看详情。',
  131. cancelButtonText: '取消',
  132. confirmButtonText: '手动打开',
  133. focusConfirm: true,
  134. showCancelButton: true,
  135. allowOutsideClick: false,
  136. allowEscapeKey: false
  137. }).then(res => {
  138. if (res.isConfirmed) {
  139. GM_openInTab(`${domains[index]}/plugin.php?id=k_misign:sign&operation=qiandao&formhash=${formhash}&format=empty`, {
  140. loadInBackground: true
  141. });
  142. }
  143. Swal.fire({
  144. icon: 'info',
  145. title: 'sijishes论坛自动签到',
  146. text: '今日是否不再尝试签到?',
  147. cancelButtonText: '否',
  148. confirmButtonText: '是',
  149. focusConfirm: true,
  150. showCancelButton: true,
  151. allowOutsideClick: false,
  152. allowEscapeKey: false
  153. }).then(res => {
  154. if (res.isConfirmed) {
  155. GM_setValue("ts", Date.now());
  156. } else {
  157. trySign(index + 1);
  158. }
  159. });
  160. });
  161. }
  162. },
  163. onerror: function () {
  164. trySign(index + 1);
  165. }
  166. });
  167. };
  168.  
  169. window.onload = () => {
  170. if (!window.location.href.match("sijishes.com") && (!GM_getValue("ts") || checkNewDay(GM_getValue("ts")))) {
  171. sign();
  172. }
  173. };

QingJ © 2025

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