From 6045b4fd741c565d2b9a0d79db8edb8567ed3389 Mon Sep 17 00:00:00 2001 From: smallfawn <101914820+smallfawn@users.noreply.github.com> Date: Sun, 30 Jul 2023 21:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E6=97=97=E6=B1=BD=E8=BD=A6=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=AF=E5=88=86=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hqkj.js | 70 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/hqkj.js b/hqkj.js index 32e3537..119f297 100644 --- a/hqkj.js +++ b/hqkj.js @@ -27,7 +27,7 @@ async function start() { for (let user of $.userList) { if (user.ckStatus) { taskall.push(await user.task()); - await $.wait(1000); + await $.wait(5000); } } await Promise.all(taskall); @@ -40,6 +40,7 @@ class UserInfo { this.ckStatus = true; this.postId = "" this.articleStatus = false + this.userId = "" this.postHeaders = { "Host": "hqpp-gw.faw.cn", "Connection": "keep-alive", @@ -63,20 +64,11 @@ class UserInfo { } async task() { $.DoubleLog(`------第[${this.index}]个账号------`); - await this.postArticle() - if (this.articleStatus == true) { - await $.wait(8000) - await this.user_info() - if (this.postId !== "") { - //await this.comment() - await this.forward() - await this.deleteArticle() - } - } else { + await this.user_point() + if (this.ckStatus == true) { await this.postArticle() if (this.articleStatus == true) { await $.wait(8000) - await this.user_info() if (this.postId !== "") { //await this.comment() await this.forward() @@ -84,18 +76,30 @@ class UserInfo { } } else { await this.postArticle() - await $.wait(8000) - await this.user_info() - if (this.postId !== "") { - //await this.comment() - await this.forward() - await this.deleteArticle() + if (this.articleStatus == true) { + await $.wait(8000) + await this.user_info() + if (this.postId !== "") { + //await this.comment() + await this.forward() + await this.deleteArticle() + } + } else { + await this.postArticle() + await $.wait(8000) + await this.user_info() + if (this.postId !== "") { + //await this.comment() + await this.forward() + await this.deleteArticle() + } } - } + } } + } async hitokoto() { @@ -198,7 +202,7 @@ class UserInfo { let options = { url: `https://hqpp-gw.faw.cn/gimc-hongqi-webapp/f/square/post/${this.postId}?_method=DELETE&_timestamp=${Date.now()}`, headers: this.postHeaders, - body: JSON.stringify({}) + body: " " }, result = await httpRequest(options); //console.log(options); @@ -215,12 +219,34 @@ class UserInfo { console.log(e); } } - + //个人主页 + async user_point() { + try { + let options = { + url: `https://hqpp-gw.faw.cn/gimc-hongqi-webapp/f/credits/userCredits/?_timestamp=${Date.now()}`, + headers: this.getHeaders, + }, + result = await httpRequest(options); + //console.log(options); + //console.log(result); + if (result.code == 200) { + this.ckStatus = true + this.userId = result.data.userId + $.DoubleLog(`✅账号[${this.index}] [${result.data.nickname}][${result.data.amount}]分🎉`); + } else { + this.ckStatus = false + $.DoubleLog(`❌账号[${this.index}] 获取个人发表文章失败`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } //个人主页 async user_info() { try { let options = { - url: `https://hqpp-gw.faw.cn/gimc-hongqi-webapp/f/square/post/user?_timestamp=${Date.now()}&pageNo=1&pageSize=20&userId=5956965`, + url: `https://hqpp-gw.faw.cn/gimc-hongqi-webapp/f/square/post/user?_timestamp=${Date.now()}&pageNo=1&pageSize=20&userId=${this.userId}`, headers: this.getHeaders, }, result = await httpRequest(options);