From b6eb16c24f7116da5042525f1b12271a60d0f5fc Mon Sep 17 00:00:00 2001 From: imoki <78804251+imoki@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:47:28 +0800 Subject: [PATCH] Create wps_light --- wps_light | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 wps_light diff --git a/wps_light b/wps_light new file mode 100644 index 0000000..a101f68 --- /dev/null +++ b/wps_light @@ -0,0 +1,55 @@ +// 推送bark消息 +function bark(message){ + let bark_push = Application.Range("E"+2).Text + if(bark_push == "是"){ + let bark_id = Application.Range("D"+2).Text + let BARK_PUSH = 'https://api.day.app/' + bark_id + "/" + message; + let barkdata = HTTP.get(BARK_PUSH, + {headers:{'Content-Type': 'application/x-www-form-urlencoded'}} + ) + barkdata = barkdata.json() + } +} + +function sleep(d){ + for(var t = Date.now();Date.now() - t <= d;); +} + +var message= "【wps轻量版】"; +var line = 21; // 默认支持20个账户 +for (let i = 2; i <= line; i++){ + var cookie = Application.Range("A"+i).Text + var exec = Application.Range("B"+i).Text + if(cookie != "" && exec == "是"){ + url = "https://vip.wps.cn/sign/v2" + headers = { + "Cookie": "wps_sid=" + cookie, + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586" + } + data = { + "platform": "8", + "captcha_pos": "137.00431974731889, 36.00431593261568", + "img_witdh": "275.164", + "img_height": "69.184" + } + + let resp = HTTP.fetch(url, { + method: "post", + headers: headers, + data: data + }) + + try{ + resp = resp.json() + var result = resp["result"] + var msg = resp["msg"] + message = message + "单元格A" + i + msg + ",签到成功 " + }catch{ + message = message + "单元格A" + i + "签到失败 " + } + console.log(resp) + sleep(2000) + } +} + +bark(message);