自用论坛辅助签到

常用论坛辅助签到工具,包括远景论坛、天使动漫论坛、52破解、TTG、卡饭等

目前為 2020-10-24 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 自用论坛辅助签到
  3. // @namespace bbshelper
  4. // @version 1.2.3
  5. // @description 常用论坛辅助签到工具,包括远景论坛、天使动漫论坛、52破解、TTG、卡饭等
  6. // @author Eva
  7. // @include http*://u2.dmhy.org/*
  8. // @include http*://*.pcbeta.com/*
  9. // @include http*://www.tsdm*.*/*
  10. // @include http*://totheglory.im/*
  11. // @include http*://www.52pojie.cn/*
  12. // @include http*://www.smzdm.com/*
  13. // @include http*://bbs.kafan.cn/*
  14. // @include http*://www.natfrp.com/*
  15. // @include http*://www.cordcloud.*/*
  16. // @include http*://www.mielink.cc/*
  17. // @include http*://zodgame.xyz/*
  18. // @include http*://o2v3.imotor.com/*
  19. // @include http*://www.flyertea.com/*
  20. // @include http*://www.55188.com/*
  21. // @include http*://fishc.com.cn/*
  22. // @grant unsafeWindow
  23. // @grant GM_getValue
  24. // @grant GM_setValue
  25. // @grant GM.deleteValue
  26. // @require https://cdn.jsdelivr.net/npm/jquery@3.5.0/dist/jquery.min.js
  27. // @run-at document-end
  28. // ==/UserScript==
  29.  
  30. (function () {
  31. // 日期格式化
  32. Date.prototype.format = function (fmt) {
  33. var o = {
  34. "M+": this.getMonth() + 1, //月份
  35. "d+": this.getDate(), //日
  36. "h+": this.getHours(), //小时
  37. "m+": this.getMinutes(), //分
  38. "s+": this.getSeconds(), //秒
  39. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  40. "S": this.getMilliseconds() //毫秒
  41. };
  42. if (/(y+)/.test(fmt)) {
  43. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  44. }
  45. for (var k in o) {
  46. if (new RegExp("(" + k + ")").test(fmt)) {
  47. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  48. }
  49. }
  50. return fmt;
  51. }
  52.  
  53. // U2
  54. if (matchURL("u2.dmhy.org")) {
  55. if (matchURL("showup.php")) {
  56. var message = $("textarea[name='message']");
  57. if (message) message.text("注意:回答按钮点击时即提交,手滑损失自负~");
  58. } else if (window.find("立即签到")) {
  59. window.location.href = "showup.php";
  60. }
  61. }
  62.  
  63. // 远景
  64. if (matchURL("bbs.pcbeta.com") || matchURL("i.pcbeta.com")) {
  65. // 判断是否登录(不可用)
  66. if ($('.vwmy').length > 0) {
  67. // 获取上次签到日期
  68. var pcbetaLastSignDate = getData('pcbeta');
  69. if (!pcbetaLastSignDate || compareDate(new Date().format("yyyy-MM-dd"), pcbetaLastSignDate)) {
  70. console.log('开始自动签到!');
  71. $.ajax({
  72. type: "GET",
  73. url: "/home.php?mod=task&do=apply&id=149",
  74. success: function (data) {
  75. if (data.indexOf('恭喜您,任务已成功完成,您将收到奖励通知,请注意查收') != -1) {
  76. console.log('签到完成!');
  77. setData('pcbeta', new Date().format("yyyy-MM-dd"));
  78. }
  79. if (data.indexOf('抱歉,本期您已申请过此任务,请下期再来') != -1) {
  80. console.log('重复签到!');
  81. setData('pcbeta', new Date().format("yyyy-MM-dd"));
  82. }
  83. }
  84. })
  85. }
  86. }
  87. }
  88.  
  89. // TTG
  90. if (matchURL("totheglory.im")) {
  91. if ($("#signed")) $("#signed")[0].click();
  92. }
  93.  
  94. // 天使动漫
  95. if (matchURL("tsdm")) {
  96. qd('签到领奖!', 'wl_s');
  97. }
  98.  
  99. // 52破解
  100. if (matchURL("52pojie.cn")) {
  101. var qdimg = $("img[src$='qds.png']");
  102. if (qdimg) {
  103. $.ajax({
  104. url: 'home.php?mod=task&do=apply&id=2',
  105. dataType: 'html',
  106. success: function (result) {
  107. if (result.indexOf('任务已完成') != -1) {
  108. console.log("签到成功!");
  109. qdimg.attr('src', 'https://www.52pojie.cn/static/image/common/wbs.png');
  110. }
  111. }
  112. })
  113. }
  114. }
  115.  
  116. // 什么值得买
  117. if (matchURL("smzdm.com")) {
  118. var signBtn = $('.J_punch');
  119. if ($('.J_punch').length > 0 && signBtn.text() == '签到领奖') {
  120. $('.J_punch')[0].click();
  121. }
  122. }
  123.  
  124. // 卡饭
  125. if (matchURL("kafan.cn")) {
  126. var dklink = $("img[src$='dk.png']").closest("a");
  127. if ($("img[src$='wb.png']").closest("a").css('display') === 'none') {
  128. dklink[0].click();
  129. }
  130. }
  131.  
  132. // Sakura Frp
  133. if (matchURL("www.natfrp.com")) {
  134. // 判断是否登录(不可用)
  135. if ($('#token').length > 0) {
  136. // 获取上次签到日期
  137. var sakuraFrpLastSignDate = getData('sakura_frp');
  138. if (!sakuraFrpLastSignDate || compareDate(new Date().format("yyyy-MM-dd"), sakuraFrpLastSignDate)) {
  139. // 跳转到签到页面
  140. window.location.href = "/user/sign";
  141. }
  142. }
  143.  
  144. // 签到
  145. if ($('#sign').length > 0) {
  146. setTimeout(function () {
  147. $('#switch_captcha')[0].click();
  148. }, 1000)
  149. setTimeout(function () {
  150. console.log('开始签到')
  151. $('#sign').click();
  152. setData('sakura_frp', new Date().format("yyyy-MM-dd"));
  153. }, 5000)
  154. } else {
  155. if (window.find("您今天已经签到过了")) {
  156. console.log('已签到')
  157. setData('sakura_frp', new Date().format("yyyy-MM-dd"));
  158. }
  159. }
  160. }
  161.  
  162. // CordCloud
  163. if (matchURL("cordcloud")) {
  164. var qdBtn = $("#checkin");
  165. if (qdBtn.length > 0) {
  166. $.ajax({
  167. type: "POST",
  168. url: "/user/checkin",
  169. dataType: "json",
  170. success: function (data) {
  171. $("#checkin-msg").html(data.msg);
  172. $("#checkin-btn").hide();
  173. $("#msg").html(data.msg);
  174. }
  175. })
  176. }
  177. }
  178.  
  179. // 羊圈
  180. if (matchURL("www.mielink.cc")) {
  181. $('body').bind('DOMNodeInserted', function (e) {
  182. if ($(e.target).find('span:contains(流量红包)').length > 0) {
  183. $('span:contains(流量红包)')[0].click()
  184. }
  185. });
  186. }
  187.  
  188. // ZodGame
  189. if (matchURL("zodgame.xyz")) {
  190. qd('', 'fd_s');
  191. }
  192.  
  193. // 神曲音乐论坛
  194. if (matchURL("o2v3.imotor.com")) {
  195. if ($('#umenu > a[href^="logging.php?action=login"]').length > 0) {
  196. console.log('未登录(不可用)');
  197. return;
  198. }
  199. // 获取上次签到日期
  200. var imotorLastSignDate = getData('imotor');
  201. if (!imotorLastSignDate || compareDate(new Date().format("yyyy-MM-dd"), imotorLastSignDate)) {
  202. if (matchURL('dps_sign:sign')) {
  203. if (window.find("今天签到了吗") && window.find("写下今天最想说的话")) {
  204. $('input[value="kx"]').attr('checked', true);
  205. $("#todaysay").val('每天签到水一发。。。');
  206. $('input[type="submit"]')[0].click();
  207. }
  208. if (window.find("您今天已经签到过了")) {
  209. setData('imotor', new Date().format("yyyy-MM-dd"));
  210. }
  211. } else if (window.find('每日签到')) {
  212. window.location.href = "plugin.php?id=dps_sign:sign";
  213. }
  214. }
  215. }
  216.  
  217. // 飞客茶馆
  218. if (matchURL("flyertea.com")) {
  219. if ($('a[data-title="签到"]').length > 0) {
  220. $.ajax({
  221. url: 'plugin.php?id=k_misign:sign&operation=qiandao&formhash=' + $("input[name='formhash']").val() + '&from=insign&is_ajax=1',
  222. dataType: 'html',
  223. success: function (result) {
  224. if (result.indexOf('签到成功') != -1) {
  225. console.log("签到成功!");
  226. location.reload();
  227. }
  228. }
  229. })
  230. }
  231. }
  232.  
  233. // 理想论坛
  234. if (matchURL("55188.com/plugin.php?id=sign")) {
  235. if ($('#addsign').length > 0) {
  236. $.ajax({
  237. url: 'plugin.php?id=sign&mod=add&jump=1',
  238. dataType: 'html',
  239. success: function (result) {
  240. if (result.indexOf('success') != -1) {
  241. console.log("签到成功!");
  242. $('#addsign').attr("class", "btn btnvisted");
  243. }
  244. }
  245. })
  246. }
  247. }
  248.  
  249. // 鱼C论坛
  250. if (matchURL("fishc.com.cn")) {
  251. // 获取上次签到日期
  252. var fishcLastSignDate = getData('fishc');
  253. if (!fishcLastSignDate || compareDate(new Date().format("yyyy-MM-dd"), fishcLastSignDate)) {
  254. if ($('#ls_username').length == 0) {
  255. // 跳转到签到页面
  256. window.location.href = "plugin.php?id=k_misign:sign";
  257. }
  258. }
  259.  
  260. // 签到
  261. if (matchURL('k_misign:sign')) {
  262. if ($('#JD_sign').length > 0) {
  263. $('#JD_sign')[0].click();
  264. console.log('签到成功!');
  265. setData('fishc', new Date().format("yyyy-MM-dd"));
  266. } else if ($('.btnvisted').length > 0) {
  267. console.log('已签到!');
  268. setData('fishc', new Date().format("yyyy-MM-dd"));
  269. }
  270. }
  271. }
  272.  
  273.  
  274. function qd(checkElement, emoji) {
  275. if (matchURL('dsu_paulsign:sign')) {
  276. if (window.find("今天签到了吗") && window.find("写下今天最想说的话")) {
  277. $("#" + emoji).attr('checked', true);
  278. $("#todaysay").val("每天签到水一发。。。");
  279. $("#qiandao").submit();
  280. }
  281. } else if (window.find(checkElement)) {
  282. window.location.href = "plugin.php?id=dsu_paulsign:sign";
  283. }
  284. }
  285.  
  286. // 比较日期大小
  287. function compareDate(date1, date2) {
  288. var d1 = new Date(date1);
  289. var d2 = new Date(date2);
  290. if (d1.getTime() > d2.getTime()) {
  291. return true;
  292. } else {
  293. return false;
  294. }
  295. }
  296.  
  297. // 获取分割后的最后的文本
  298. function getLastText(text, separtor) {
  299. var arr = text.split(separtor);
  300. return arr[arr.length - 1];
  301. }
  302.  
  303. function getStorageData() {
  304. var data = GM_getValue('BBSSignHelperData');
  305. if (!data) {
  306. data = {};
  307. }
  308. return data;
  309. }
  310.  
  311. function getData(key) {
  312. var data = getStorageData();
  313. return data[key];
  314. }
  315.  
  316. function setData(key, value) {
  317. var data = getStorageData();
  318. data[key] = value;
  319. return GM_setValue('BBSSignHelperData', data);
  320. }
  321.  
  322. function deleteStorageData() {
  323. GM.deleteValue("BBSSignHelperData");
  324. }
  325.  
  326. function matchURL(x) {
  327. return window.location.href.indexOf(x) != -1;
  328. }
  329. })();

QingJ © 2025

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