mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 08:19:11 +08:00
15 lines
90 KiB
JavaScript
15 lines
90 KiB
JavaScript
|
/*
|
|||
|
环境变量:
|
|||
|
export jd_opencard_draw="3" //抽奖次数 3
|
|||
|
export jd_opencard_notify="true" // 是否推送
|
|||
|
|
|||
|
cron:59 23 29 2 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('1.15 年味合家欢 家满团圆味')
|
|||
|
function Vj81tf(){}var LL1nLH=Object['defineProperty'],xOkCad,ZePUIT,X27Au2X,b_ybH1F,jKEh9mH,i7qJid,VxfGt3X,QsN537,cewvgw2,uWI3BW,gF_yvC,XVJ_cnb,Ci1kla,e75KvQ,FpF0nh,OOxlm0O,LCpFdjZ;function nCaYlv9(Vj81tf){return xOkCad[Vj81tf<0x5b?Vj81tf>0x5b?Vj81tf+0x51:Vj81tf>0x5b?Vj81tf-0x52:Vj81tf+0x27:Vj81tf-0x2]}Vj81tf(xOkCad=IXSnaN1(),ZePUIT=Jv4yUsy((Vj81tf,LL1nLH)=>{return LL1nLH(Vj81tf())},0x2)(QmqEUhP,rffaWki));var Y37dJU=[],l7soBf=[KIPeDqB(nCaYlv9(-0x16)),'\u006e\u0058\u006f\u0024\u002c\u005b\u004e\u0055','\x6d\x2e\x25\x7d\x58\x6e\x2c\x4c','\x43\x77\x50\x46\x5e','\x67\x38\x53\x46','\u0044\u0036\u0054\u0064\u006d\u0043\u0029\u0026\u0071\u0033\u004a\u0032\u007c\u0037\u004c\u0044\u0071\u0074\u0068\u0073\u0047\u005d\u0034','\x37\x7e\x64\x5f\x68','D6TdmC)&q3J2|7%!mfgF','St"Fnc(][vuT}|:`iSIEl_nudy?}17%`q8"XMX4','\u003b\u0057\u006e\u004a\u003a',KIPeDqB(nCaYlv9(-0xe)),KIPeDqB(nCaYlv9(-0x7)),'\x77\x73\x41\x56',KIPeDqB(nCaYlv9(-0x20)),'\u0067\u0052\u006a\u0074\u007c\u0050\u007e\u0059\u0029\u003a\u003e\u0049\u0037\u007c\u0069\u0063\u0074\u006b\u0072\u0059\u0029\u003d\u0026\u0037\u0068\u0045\u005f\u003b\u0047\u0038\u0050\u0039\u0057\u005f\u0032\u002a\u0068',KIPeDqB(nCaYlv9(0x48)),KIPeDqB(nCaYlv9(-0x27)),'\x52\x66\x50\x5f\x68',KIPeDqB(nCaYlv9(-0x13)),'\x53\x74\x22\x46\x56\x60\x39\x5d\x38\x33\x3b\x7e\x30\x69\x7a\x6e\x25\x6a\x31\x5b\x3b\x38\x52\x4b\x5f\x22\x69\x6b\x7e\x5b\x2f\x59\x53\x51\x6a\x73\x28\x3f\x78\x4e\x53\x75','\x41\x69\x74\x33\x77\x45\x67\x25\x77\x70\x48',KIPeDqB(nCaYlv9(-0x9)),KIPeDqB(0x8),'\x45\x57\x2a\x5f\x38\x56\x2f\x51','\x26\x40\x58\x2e\x32\x3c\x78\x66\x5b\x32\x69\x3d\x39',nCaYlv9(-0x1c),'\u004f\u0074\u0069\u004d\u003b\u007b\u003d\u0066\u004d\u003a\u0064\u0070\u004d\u0071\u002b\u0052\u005a\u0056\u004f\u002e\u0032\u003c\u0024\u003c\u0049\u0073\u0052\u002a\u0052\u004c\u0075\u004c\u0025\u0029\u0071','\u0042\u005f\u003d\u003e\u0079\u005d\u0024\u0028\u0043\u0055\u002a\u0045\u0062\u002e',KIPeDqB(0x9),KIPeDqB(0x7),KIPeDqB(nCaYlv9(0x25)),KIPeDqB(nCaYlv9(0x19)),KIPeDqB(nCaYlv9(-0x3)),KIPeDqB(nCaYlv9(-0xb)),KIPeDqB(nCaYlv9(0x11)),'\u0023\u0032\u0072\u0044\u0029\u0048\u0079\u0031\u0031\u003a',KIPeDqB(nCaYlv9(-0x11)),'\x40\x77\x23\x6f\x6d\x24\x6c\x51',KIPeDqB(nCaYlv9(-0x1)),KIPeDqB(0x11),'\u0024\u0040\u0057\u007a\u0037\u002f\u0067\u0041',KIPeDqB(0x12),'\x28\x38\x77\x5f\x4a\x63\x43\x5d\x73\x7b\x3e\x7a\x60\x66','\u0060\u003b\u006b\u003e\u0026\u007b\u002f\u0051','[%<X|','u.5_N0nQ','HWa_;iSu53bo<','"B#>~{"kVk!3Kiat',KIPeDqB(0x13),KIPeDqB(0x14),KIPeDqB(nCaYlv9(0x4)),'8%u_yX<v+','\x5b\x2e\x75\x5f\x68','\x67\x38\x64\x41\x2b\x3f\x31\x70\x6d','\x62\x73\x42\x76\x38\x26\x45\x2b\x26\x48',KIPeDqB(nCaYlv9(0x3)),'P.N*zE1R',KIPeDqB(0x5),'\u0058\u003a\u0021\u003d\u0055\u0049\u0032\u006c\u0068\u0034\u002b\u0069\u0029\u006f\u006d\u0025\u006f\u0066\u004f\u0043\u0078\u0049\u007a\u0060\u0056\u002c\u0055\u0056\u0046\u0053\u0060\u003b\u0079\u006f\u002c\u0067\u0047\u007e\u0053\u0042\u003c\u0026\u007b\u005b\u0063',KIPeDqB(0x17),KIPeDqB(0x18),'\u003e\u0032\u003e\u006b\u0049\u007b\u004a\u002b\u005e\u0078\u005a\u005d\u006e\u0046\u0022\u004c\u0073\u0044\u006d\u0059\u0066\u0022\u007a',KIPeDqB(0x19),KIPeDqB(nCaYlv9(0x5)),KIPeDqB(nCaYlv9(-0x2)),'\u004b\u0056\u0061\u005f\u0068\u0037\u0079\u0052','\x43\x29\x71\x5a\x3b\x78\x63\x75','\u0034\u0045\u0043\u0042\u002f\u0052\u007a','p!5MuP;u',nCaYlv9(-0x25),nCaYlv9(-0x26),KIPeDqB(0x1c),KIPeDqB(0x1d),KIPeDqB(0x5),KIPeDqB(0x1e),'T2^pnWy8v',KIPeDqB(nCaYlv9(-0x6)),'/.Z*9@YR','\x57\x57\x61\x5f\x46\x3f\x3e\x75\x2b','\u003a\u0032\u0071\u005a\u005e',KIPeDqB(0x20),'\u0045\u0033\u0071\u005a\u0055\u0057\u0025\u0057\u004c\u0056\u0070',KIPeDqB(nCaYlv9(0x8)),'\u003a\u0070\u0050\u0034\u005e',KIPeDqB(0x22),KIPeDqB(0x23),'\x42\x25\x7b\x56\x42\x24\x21\x35\x28\x33\x56\x6a\x65\x37\x35','\u0062\u0073\u002a\u003a\u0077\u0045\u002b\u0075\u0056\u006e\u0065\u007e\u003c',KIPeDqB(nCaYlv9(0x9)),'wPRM6)uQf','\x62\x55\x61\x6f\x3d\x79\x38\x4d\x4c\x5f',KIPeDqB(0x25),KIPeDqB(0x26),'\x4f\x49\x34\x70\x53',KIPeDqB(0x27),'\u0043\u0040\u002c\u005d\u0031\u0036\u006e\u006a\u0032\u004c\u0025\u006a\u0043\u007c\u0069\u0079\u0054\u002a\u0045\u006b\u0042\u005d\u0028\u0
|
|||
|
|
|||
|
// prettier-ignore
|
|||
|
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.d
|