52pojie吾爱破解论坛自动签到助手_免打扰_2022

打开论坛自动签到, 无其他提示

  1. // ==UserScript==
  2. // @icon https://www.52pojie.cn/favicon.ico
  3. // @name 52pojie吾爱破解论坛自动签到助手_免打扰_2022
  4. // @namespace https://zfdev.com/
  5. // @version 0.6
  6. // @description 打开论坛自动签到, 无其他提示
  7. // @author ZFDev
  8. // @match *://www.52pojie.cn/*
  9. // @exclude *://www.52pojie.cn/home.php?mod=task*
  10. // @run-at document-idle
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. function saveDate(){
  17. localStorage.setItem('autoSign',new Date().toDateString());
  18. }
  19. function isTody(){
  20. var lastSignDate = localStorage.getItem('autoSign');
  21. if(lastSignDate){
  22. return new Date(lastSignDate).toDateString() === new Date().toDateString();
  23. }else{
  24. return false;
  25. }
  26. }
  27.  
  28. function bSign(){
  29. return new Promise(function (resolve, reject) {
  30. var f = document.createElement('iframe')
  31. // f.style="width:1000px;height:500px;display: none;outline: none;"
  32. f.src = "/home.php?mod=task&do=apply&id=2&referer=%2Fforum.php"
  33. f.style="width:1000px;height:500px;"
  34. f.onload = function(e){
  35. var u = e.target.contentWindow.location.search
  36. var c = f.contentWindow.document.body.textContent
  37. if (u.indexOf(s.p)>=0) {
  38. if (c.indexOf(s.n) > 0){
  39. } else {
  40. f.remove()
  41. resolve(c)
  42. }
  43. }
  44. }
  45. document.body.append(f)
  46.  
  47. })
  48.  
  49. }
  50.  
  51. let s = {
  52. a: "正在自动签到...",
  53. b: "本期您已申请过此任务",
  54. c: "您已经签到了!",
  55. d: "任务已完成",
  56. f: "签到成功!",
  57. g: "签到失败!",
  58. h: '<img src="https://static.52pojie.cn/static/image/common/wbs.png" class="qq_bind" align="absmiddle" alt="">',
  59. i: "自动签到中..",
  60. j: '#hd .wp #um p > a > img[src*="qds.png"]',
  61. k: 'home.php?mod=task&do=apply&id=2',
  62. l: 'home.php?mod=task&do=draw&id=2',
  63. m: '403 Forbidden',
  64. n: '请开启JavaScript并刷新该页',
  65. o: 0,
  66. p: '?mod=task&do=draw',
  67. q: '?mod=task&do=apply',
  68.  
  69. }
  70. function autoSign(num) {
  71. if (!isTody()){
  72. let a = document.querySelector(s.j);
  73. if(s.o || a){
  74. s.o = 1
  75. a = a.parentNode;
  76. a.text = s.i;
  77. try{
  78. var x = new Ajax();
  79.  
  80. }catch(e){
  81. if(!num || num < 2){
  82. setTimeout(function(){
  83. autoSign(num+1);
  84. },2000);
  85. }
  86. return;
  87. }
  88. console.log(s.a);
  89. bSign().then(function (res) {
  90. if(res.indexOf(s.b)>0){
  91. console.log(s.c);
  92. saveDate();
  93. a.outerHTML = s.h;
  94. }else if(res.indexOf(s.d)>0){
  95. console.log(s.f);
  96. saveDate();
  97. a.outerHTML = s.h;
  98. }else if(res.indexOf(s.m)>0 || res.indexOf(s.n)>0){
  99. autoSign(0);
  100. }else{
  101. console.log(s.g);
  102. }
  103. })
  104. }
  105. }
  106. }
  107. autoSign(0);
  108. })();
  109.  
  110.  
  111.  
  112.  

QingJ © 2025

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