精易论坛
标题:
Node js 奇瑞俱乐部签到 源码
[打印本页]
作者:
wadclife
时间:
2020-9-12 19:37
标题:
Node js 奇瑞俱乐部签到 源码
const axios = require("axios")
const schedule = require("node-schedule")
const config = {
headers: {}
}
const user = "" //账号
const pass = "" //密码
async function sign() {
let re = ""
re = await axios.get("https://cheryclub.mychery.com/ump/cherypc/indexPC/index", )
let formToken = re.data.match(/name="formToken" value="(.*?)" \/>/)[1];
console.log(formToken);
config.headers.Cookie = re.headers['set-cookie'][0]
re = await axios.post("https://cheryclub.mychery.com/ump/cherypc/pcLogin/checkLogin",
`user=${user}&password=${pass}`, config)
console.log(re.data);
re = await axios.post("https://cheryclub.mychery.com/ump/cherypc/indexPC/addSign",
"formToken=" + formToken, config)
console.log(re.data);
return re.data.msg == "succ" ? true : false
}
async function start() {
for (let i = 0; i < 3; i++) {
if (await sign()) break
}
}
schedule.scheduleJob('0 0 8 * * *', () => {
start()
})
console.log(new Date + "脚本启动成功,每天8点定时签到!")
复制代码
作者:
被封禁言
时间:
2020-9-12 21:38
这个不会跨域么
作者:
Killing
时间:
2020-9-12 23:05
作者:
wadclife
时间:
2020-9-13 00:36
被封禁言 发表于 2020-9-12 21:38
这个不会跨域么
node 环境运行.不是浏览器
作者:
小清晰2020
时间:
2020-9-14 09:24
看看11111
欢迎光临 精易论坛 (https://125.confly.eu.org/)
Powered by Discuz! X3.4