🔥任何网页下完成🔥52破解论坛&吾爱破解论坛自动签到

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

  1. // ==UserScript==
  2. // @name 🔥任何网页下完成🔥52破解论坛&吾爱破解论坛自动签到
  3. // @namespace https://gf.qytechs.cn/zh-CN/users/690532-xht1810
  4. // @version 1.0.1.0
  5. // @description 在任何网页下完成吾爱破解论坛签到, 使用了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. /* global Swal */
  18. const url = "https://www.52pojie.cn/home.php?mod=task&do=apply&id=2"; // https://www.52pojie.cn/home.php?mod=task&do=draw&id=2
  19.  
  20. const checkNewDay = (ts) => {
  21. const t = new Date(ts);
  22. t.setMinutes(t.getMinutes());
  23. t.setHours(0, 0, 0, 0);
  24. const d = new Date();
  25. d.setMinutes(t.getMinutes());
  26. return (d - t > 86400e3);
  27. };
  28.  
  29. const sign = () => {
  30. if (GM_getValue("notified")) {
  31. sendRequest();
  32. } else {
  33. Swal.fire(`由于脚本使用了tampermonkey进行跨域请求, 弹出提示请选择"总是允许域名"`).then(() => {
  34. GM_setValue("notified", true);
  35. sendRequest();
  36. });
  37. }
  38. };
  39.  
  40. const sendRequest = () => {
  41. GM_xmlhttpRequest({
  42. method: "GET",
  43. url: url,
  44. timeout: 10e3,
  45. onload: response => {
  46. response = response.response;
  47. if (response.match("任务已完成") !== null) {
  48. Swal.fire({
  49. icon: 'success',
  50. title: '52破解论坛自动签到',
  51. html: `<strong>成功!</strong>`
  52. });
  53. GM_setValue("ts", Date.now());
  54. } else if (response.match("您已申请过此任务") !== null) {
  55. Swal.fire({
  56. icon: 'warning',
  57. title: '52破解论坛自动签到',
  58. text: '您已经签到过了!'
  59. });
  60. GM_setValue("ts", Date.now());
  61. } else if (response.match("您需要先登录(不可用)才能继续本操作") !== null) {
  62. Swal.fire({
  63. icon: 'error',
  64. title: '52破解论坛自动签到',
  65. text: '您需要先登录(不可用)才能继续本操作!'
  66. });
  67. } else {
  68. console.log(response);
  69. Swal.fire({
  70. icon: 'error',
  71. title: '52破解论坛自动签到',
  72. text: '未知返回信息❗ 请打开控制台查看详情。',
  73. cancelButtonText: '取消',
  74. confirmButtonText: '手动打开',
  75. focusConfirm: true,
  76. showCancelButton: true,
  77. allowOutsideClick: false,
  78. allowEscapeKey: false
  79. }).then(res => {
  80. if (res.isConfirmed) {
  81. GM_openInTab(url, {
  82. loadInBackground: true
  83. });
  84. }
  85. Swal.fire({
  86. icon: 'info',
  87. title: '52破解论坛自动签到',
  88. text: '今日是否不再尝试签到?',
  89. cancelButtonText: '否',
  90. confirmButtonText: '是',
  91. focusConfirm: true,
  92. showCancelButton: true,
  93. allowOutsideClick: false,
  94. allowEscapeKey: false
  95. }).then(res => {
  96. if (res.isConfirmed) {
  97. GM_setValue("ts", Date.now());
  98. }
  99. });
  100. });
  101. }
  102. },
  103. onerror: function () {
  104. Swal.fire({
  105. icon: 'error',
  106. title: '52破解论坛自动签到',
  107. text: '请求签到时发生错误, 请检查网络或代理, 防火墙等',
  108. });
  109. }
  110. });
  111. };
  112.  
  113. window.onload = () => {
  114. if (!window.location.href.match("52pojie.cn") && (!GM_getValue("ts") || checkNewDay(GM_getValue("ts")))) {
  115. sign();
  116. }
  117. };

QingJ © 2025

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