更新阅读文章任务

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 userIdx = 0;
let userList = [];
let msg = ""
class Task {
constructor(str) {
this.index = ++userIdx;
@@ -35,8 +34,12 @@ class Task {
await this.LuckDrawApi()
await this.ArticleListApi()
if (this.articleId !== "") {
await this.ReadStartApi(this.articleId)
await this.LikeApi(this.articleId)
await this.ShareApi(this.articleId)
$.log(`模拟阅读55s`)
await $.wait(55000)
await this.ReadEndApi(this.articleId)
}
}
async taskRequest(method, url, body = "") {
@@ -76,7 +79,6 @@ class Task {
} else {
$.log(`账号[${this.userId}] 获取抽奖信息失败 ${LuckDrawNumResult.message}`);
}
} catch (e) {
console.log(e);
}
@@ -96,6 +98,33 @@ class Task {
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) {
try {
let ShareResult = await this.taskRequest("post", `https://qualcomm.growthideadata.com/qualcomm-app/api/article/shareDaily`, `articleId=${articleId}&userId=${this.userId}`)