更新阅读文章任务

This commit is contained in:
smallfawn
2024-03-24 14:44:52 +08:00
committed by GitHub
parent 9d08f3e5ac
commit 2b7e6454ea

View File

@@ -16,7 +16,6 @@ let envSplitor = ["&", "\n"]; //多账号分隔符
let strSplitor = "#"; //多变量分隔符 let strSplitor = "#"; //多变量分隔符
let userIdx = 0; let userIdx = 0;
let userList = []; let userList = [];
let msg = ""
class Task { class Task {
constructor(str) { constructor(str) {
this.index = ++userIdx; this.index = ++userIdx;
@@ -35,8 +34,12 @@ class Task {
await this.LuckDrawApi() await this.LuckDrawApi()
await this.ArticleListApi() await this.ArticleListApi()
if (this.articleId !== "") { if (this.articleId !== "") {
await this.ReadStartApi(this.articleId)
await this.LikeApi(this.articleId) await this.LikeApi(this.articleId)
await this.ShareApi(this.articleId) await this.ShareApi(this.articleId)
$.log(`模拟阅读55s`)
await $.wait(55000)
await this.ReadEndApi(this.articleId)
} }
} }
async taskRequest(method, url, body = "") { async taskRequest(method, url, body = "") {
@@ -69,14 +72,13 @@ class Task {
if (LuckDrawTaskResult.code == 200) { if (LuckDrawTaskResult.code == 200) {
$.log(`账号[${this.userId}] 抽奖成功 获得[${LuckDrawTaskResult.data.name}]`) $.log(`账号[${this.userId}] 抽奖成功 获得[${LuckDrawTaskResult.data.name}]`)
} else { } else {
//console.log(LuckDrawTaskResult) //console.log(LuckDrawTaskResult)
$.log(`账号[${this.userId}] 抽奖失败 ${LuckDrawTaskResult.message}`); $.log(`账号[${this.userId}] 抽奖失败 ${LuckDrawTaskResult.message}`);
} }
} }
} else { } else {
$.log(`账号[${this.userId}] 获取抽奖信息失败 ${LuckDrawNumResult.message}`); $.log(`账号[${this.userId}] 获取抽奖信息失败 ${LuckDrawNumResult.message}`);
} }
} catch (e) { } catch (e) {
console.log(e); console.log(e);
} }
@@ -96,6 +98,33 @@ class Task {
console.log(e); console.log(e);
} }
} }
async ReadStartApi(articleId) {
try {
let ReadStartApi = await this.taskRequest("post", `https://qualcomm.growthideadata.com/qualcomm-app/api/article/enterReadDaily`, `articleId=${articleId}&userId=${this.userId}`)
if (ReadStartApi.code == 200) {
$.log(`✅账号[${this.userId}] 阅读文章开始上传成功🎉`);
} else {
$.log(`❌账号[${this.userId}] 阅读文章开始上传失败 [${ReadStartApi.message}]`);
}
} catch (e) {
console.log(e);
}
}
async ReadEndApi(articleId) {
try {
let ReadEndApi = await this.taskRequest("post", `https://qualcomm.growthideadata.com/qualcomm-app/api/article/exitReadDaily`, `articleId=${articleId}&userId=${this.userId}`)
if (ReadEndApi.code == 200) {
$.log(`✅账号[${this.userId}] 阅读文章结束上传成功🎉`);
} else {
$.log(`❌账号[${this.userId}] 阅读文章结束上传失败 [${ReadEndApi.message}]`);
}
} catch (e) {
console.log(e);
}
}
async ShareApi(articleId) { async ShareApi(articleId) {
try { try {
let ShareResult = await this.taskRequest("post", `https://qualcomm.growthideadata.com/qualcomm-app/api/article/shareDaily`, `articleId=${articleId}&userId=${this.userId}`) let ShareResult = await this.taskRequest("post", `https://qualcomm.growthideadata.com/qualcomm-app/api/article/shareDaily`, `articleId=${articleId}&userId=${this.userId}`)