// ==UserScript== // @name 致美化签到 // @namespace 倚楼听风雨 // @description 致美化签到 // @version 1.1.6 // @author 倚楼听风雨 // @crontab * 1-23 once * * // @grant GM_xmlhttpRequest // @grant GM_notification // @connect zhutix.com // @connect zhutix.com // @cloudCat // @exportCookie domain=.zhutix.com // ==/UserScript== return new Promise((resolve, reject) => { GM_xmlhttpRequest({ method: 'GET', url: 'https://zhutix.com/wp-admin/admin-ajax.php?action=b2_get_login_token', responseType: "json", onload: function (xhr12) { var jsonret = xhr12.responseText; var jsonret2 = JSON.parse(jsonret); var token = jsonret2.data.token; GM_xmlhttpRequest({ method: 'POST', url: 'https://zhutix.com/wp-json/b2/v1/userMission', headers: { "Authorization": "Bearer " + token }, responseType: "text", onload: function (xhr) { var ret = xhr.responseText; var information = ret.slice(1, 2); if (information == 2 || information == 1 || information == 3) { GM_notification({ title: '致美化', text: '今日以签到过了,明天在来签到吧!', timeout: 3000, }); resolve('重复签到!'); } var bs = ret.indexOf('bs'); var jf = ret.slice(bs + 5, bs + 6); console.log("积分:" + jf); if (jf != null && jf > 0) { GM_notification({ title: '致美化', text: "今日签到成功,获取到:" + jf + "积分。", timeout: 3000, }); resolve('日志:' + xhr.responseText); } else { resolve('签到错误日志:' + xhr.responseText); } }, onerror: function () { GM_notification({ title: '致美化签到自动签到 - ScriptCat', text: '网络错误,致美化签到签到失败', }); reject('网络错误,致美化签到签到失败'); } }); resolve('日志:Authorization请求头信息' + token); } }); });