|
|
@@ -38,6 +38,7 @@ async function Main() {
|
|
|
} else {
|
|
|
gCommonHeaders[`Cookie`] = magicJS.data.read('52pojie_cookie');
|
|
|
await signIn();
|
|
|
+ await taskDraw();
|
|
|
}
|
|
|
magicJS.notification.msg('');
|
|
|
if (gRetBody) {
|
|
|
@@ -69,8 +70,7 @@ function checkHandleRequest() {
|
|
|
|
|
|
|
|
|
async function signIn() {
|
|
|
- let url = `https://www.52pojie.cn/home.php?mod=task&do=apply&id=2&mobile=no`;
|
|
|
- url = `https://www.52pojie.cn/home.php?mod=task&do=apply&id=2&referer=%2F`;
|
|
|
+ let url = `https://www.52pojie.cn/home.php?mod=task&do=apply&id=2&referer=%2F`;
|
|
|
let options = {
|
|
|
url: url,
|
|
|
headers: gCommonHeaders,
|
|
|
@@ -88,20 +88,51 @@ async function signIn() {
|
|
|
const msg = `请求签到异常\n${JSON.stringify(err)}`;
|
|
|
magicJS.logger.error(msg);
|
|
|
});
|
|
|
+ // if (!result) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // if (result.match(/\u606d\u559c\u60a8/)) {//恭喜您
|
|
|
+ // magicJS.notification.appendNotifyInfo(`🎉恭喜你今日签到成功!`);
|
|
|
+ // } else {
|
|
|
+ // if (result.match(/\u4e0b\u671f\u518d\u6765/)) {//下期再来
|
|
|
+ // magicJS.notification.appendNotifyInfo(`⚠️今日已经签到,下次再次!!!`);
|
|
|
+ // } else {
|
|
|
+ // if (result.match(/\u9700\u8981\u5148\u767b\u5f55/)) {//需要先登录
|
|
|
+ // magicJS.notification.appendNotifyInfo(`❌请先登录获取最新Cookie!!!`);
|
|
|
+ // } else {
|
|
|
+ // magicJS.notification.appendNotifyInfo(`❌信息未正常处理,请更新脚本!!!`);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+}
|
|
|
+
|
|
|
+async function taskDraw() {
|
|
|
+ let url = `https://www.52pojie.cn/home.php?mod=task&do=draw&id=2&referer=https%3A%2F%2Fwww.52pojie.cn%2F.%2F%2F`;
|
|
|
+ let options = {
|
|
|
+ url: url,
|
|
|
+ headers: gCommonHeaders,
|
|
|
+ body: ``,
|
|
|
+ };
|
|
|
+ let result = await magicJS.http.get(options).then(response => {
|
|
|
+ try {
|
|
|
+ let rspData = response.body;
|
|
|
+ magicJS.logger.info(`rspData=${JSON.stringify(rspData)}`);
|
|
|
+ return rspData;
|
|
|
+ } catch (e) {
|
|
|
+ magicJS.logger.error(e);
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ const msg = `请求任务异常\n${JSON.stringify(err)}`;
|
|
|
+ magicJS.logger.error(msg);
|
|
|
+ });
|
|
|
if (!result) {
|
|
|
return;
|
|
|
}
|
|
|
- if (result.match(/\u606d\u559c\u60a8/)) {//恭喜您
|
|
|
- magicJS.notification.appendNotifyInfo(`🎉恭喜你今日签到成功!`);
|
|
|
+ if (result.match(/恭喜您/)) {//恭喜您
|
|
|
+ magicJS.notification.appendNotifyInfo(`🎉恭喜您,任务已完成,关注论坛微信“吾爱破解论坛”,一键签到送论坛币。`);
|
|
|
} else {
|
|
|
- if (result.match(/\u4e0b\u671f\u518d\u6765/)) {//下期再来
|
|
|
- magicJS.notification.appendNotifyInfo(`⚠️今日已经签到,下次再次!!!`);
|
|
|
- } else {
|
|
|
- if (result.match(/\u9700\u8981\u5148\u767b\u5f55/)) {//需要先登录
|
|
|
- magicJS.notification.appendNotifyInfo(`❌请先登录获取最新Cookie!!!`);
|
|
|
- } else {
|
|
|
- magicJS.notification.appendNotifyInfo(`❌信息未正常处理,请更新脚本!!!`);
|
|
|
- }
|
|
|
+ if (result.match(/不是进行中的任务/)) {//下期再来
|
|
|
+ magicJS.notification.appendNotifyInfo(`⚠️不是进行中的任务!`);
|
|
|
}
|
|
|
}
|
|
|
}
|