// ==UserScript== // @name WONG公益站自动签到 // @namespace https://wzw.pp.ua/console/topup // @version 0.1.1 // @description WONG公益站自动签到,每天自动签到一次,失败则通知 // @author Wilsons // @crontab * * once * * // @grant GM_notification // @grant GM_xmlhttpRequest // @grant GM_getValue // ==/UserScript== /* ==UserConfig== config: userId: title: 您的用户ID description: 可在WONG公益站-个人设置的顶部查看 type: text default: min: 1 max: 64 password: false cookies: title: 您的Cookies description: 控制台-应用-Cookie中查看 type: text default: min: 1 max: 1024 password: false ==/UserConfig== */ return new Promise((resolve, reject) => { //$$('.semi-card-body [data-popupid]') let cookies = GM_getValue('config.cookies') || ''; if(!cookies.includes('session=')) cookies = 'session=' + cookies; const userId = GM_getValue('config.userId') || ''; if(!userId || !cookies.replace('session=', '')) { GM_notification("签到失败!用户ID和cookies不能为空!"); resolve(); return; } GM_xmlhttpRequest({ method: "POST", url: "https://wzw.pp.ua/api/user/checkin", headers: { "accept": "application/json, text/plain, */*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8", "cache-control": "no-store", "content-length": "0", "Cookie": cookies, "new-api-user": userId, "origin": "https://wzw.pp.ua", "pragma": "no-cache", "priority": "u=1, i", "referer": "https://wzw.pp.ua/console/topup", "sec-ch-ua": '"Google Chrome";v="143", "Chromium";v="143", "Not A(Brand";v="24"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": '"macOS"', "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36" }, onload: function(response) { console.log("签到成功:", response.responseText); try { let json = JSON.parse(response.responseText); if(json.success !== true) { GM_notification("签到失败!" + (json?.message || '')); } } catch (e) { console.error("签到失败!" + (error?.message || '')); } //GM_notification("签到结果: " + response.responseText); }, onerror: function(error) { console.error("签到失败:", error); GM_notification("签到失败!" + (error?.message || '')); } }); resolve(); });