// ==UserScript== // @name WONG公益站自动签到 // @namespace https://wzw.pp.ua/console/topup // @version 0.1.0 // @description WONG公益站自动签到 // @author Wilsons // @crontab * * once * * // @grant GM_notification // @grant GM_xmlhttpRequest // @grant GM_getValue // ==/UserScript== /* ==UserConfig== config: 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; //debugger; 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": "9482", "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(); });