diff --git a/README.md b/README.md index 6744d9e4..5b3164e0 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ - [x] [linkai](https://chat.link-ai.tech/home?share=GBoWyH)每日签到 - [x] [泡芙加速器](https://paofujiasu.com/)每日签到+看广告+兑换(抓包vx小程序) - [x] [海贼王论坛](https://bbs.talkop.com/)每日签到 + - [x] [共创世界](https://www.ccw.site/)每日签到 @@ -133,6 +134,8 @@ ql repo https://github.com/Wenmoux/checkbox.git "checkbox|install" "old" "module # other
更新日志 + +- 2024-01-01 新增[共创世界](https://www.ccw.site/)每日签到 - 2023-11-23 新增[海贼王论坛](https://bbs.talkop.com/)每日签到 by LinYuanovo - 2023-11-22 新增[泡芙加速器](https://paofujiasu.com/)每日签到+看广告+兑换 by LinYuanovo - 2023-10-23 新增[linkai](https://chat.link-ai.tech/home?share=GBoWyH)每日签到 diff --git a/config.yml.temple b/config.yml.temple index ffe4fb05..09262129 100644 --- a/config.yml.temple +++ b/config.yml.temple @@ -422,3 +422,7 @@ pfjsq: hzw: cookie: formhash: + +# 共创世界 +ccw: + token: \ No newline at end of file diff --git a/scripts/ccw.js b/scripts/ccw.js new file mode 100644 index 00000000..4f4108de --- /dev/null +++ b/scripts/ccw.js @@ -0,0 +1,60 @@ +const axios = require('axios'); + +let msg = "【共创世界】:\n"; +const token = config.ccw.token +const headers = { + 'Content-Type': 'application/json', + token +}; + +async function checkIn() { + const url = 'https://community-web.ccw.site/study-community/check_in_record/insert'; + const body = { + "scene": "HOMEPAGE" + }; + + try { + const response = await axios.post(url, body, { headers }); + if (response.data && response.data.code === "200") { + console.log("签到成功"); + return "成功"; + } else if (response.data && response.data.code === "10736001") { + console.log("用户已签到"); + return "用户已签到"; + } else { + return "签到失败"; + } + } catch (error) { + console.error("签到失败", error); + return "签到失败"; + } +} + +async function queryBalance() { + const url = 'https://community-web.ccw.site/currency/account/personal'; + + try { + const response = await axios.post(url, {}, { headers }); + if (response.data && response.data.code === "200" && response.data.body) { + console.log("当前积分:", response.data.body.internalCurrencyBalance); + return response.data.body.internalCurrencyBalance.toString(); + } else { + return "获取积分失败"; + } + } catch (error) { + console.error("查询失败", error); + return "查询失败"; + } +} + +async function task() { + let checkInMsg = await checkIn(); + let balanceMsg = await queryBalance(); + msg += `签到:${checkInMsg}\n积分:${balanceMsg}`; +// console.log(msg); + return msg +} + +//task(); // 如果你想在文件执行时直接运行 task 函数 + +module.exports = task; // 允许其他文件导入并使用 task 函数