加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jd_bean_sign.ts 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
JDHelloWorld 提交于 2022-01-19 19:12 . cookiesArr: string[]
import axios from "axios";
import {readFileSync, writeFileSync, unlinkSync} from "fs";
import {execSync} from "child_process";
import {requireConfig} from "./TS_USER_AGENTS";
import {sendNotify} from './sendNotify';
let message: string = '';
async function main() {
let cookiesArr: string[] = await requireConfig();
let cookiesNobyDa: {
cookie: string
}[] = []
for (let i = 0; i < cookiesArr.length; i++) {
cookiesNobyDa.push({cookie: cookiesArr[i]})
}
let data: any = '';
try {
data = await axios.get('https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js', {timeout: 5000})
data = data.data
console.log('raw')
} catch (e) {
console.log('非脚本问题!网络错误,访问github失败')
}
if (data.indexOf('京东多合一签到脚本') > -1) {
data = data.replace('var OtherKey = ``;', `var OtherKey = \`${JSON.stringify(cookiesNobyDa)}\`;`)
data = data.replace(/ztmFUCxcPMNyUq0P/g, 'q8DNJdpcfRQ69gIx')
writeFileSync('./sign.js', data, 'utf-8')
execSync('node ./sign.js >> ./sign.log')
data = readFileSync('./sign.log', 'utf-8')
data = data.match(/【.*/gm)
message += data.join('\n').replace(/红包/g, '红包\n\n')
unlinkSync('./sign.js')
unlinkSync('./sign.log')
}
await sendNotify('京东多合一签到脚本 via NobyDa@Github', message)
}
main().then()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化