mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
12 lines
68 KiB
JavaScript
12 lines
68 KiB
JavaScript
|
/*
|
||
|
超市跨年答题抽奖
|
||
|
|
||
|
cron:59 23 29 2 *
|
||
|
|
||
|
*/
|
||
|
const $ = new Env('超市跨年答题抽奖')
|
||
|
function l0IGjqS(){}var GISfFN=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],ok4niZ5,OEs7Ubr,UlGRvuo,nAhkRM_,LOj8h4,hHuODb,Vkz5K1v,XuxD4Di,Vow05w,FEYFEL,_h69w7,Fz7BYB,JRpQ1N,dc82c0E,RBCDG1;function OYx_ev(l0IGjqS){return ok4niZ5[l0IGjqS<0x62?l0IGjqS+0x34:l0IGjqS<0x62?l0IGjqS-0x31:l0IGjqS<0xb5?l0IGjqS-0x63:l0IGjqS-0xf]}l0IGjqS(ok4niZ5=OXN0ouO(),OEs7Ubr=gmKOyV((l0IGjqS,GISfFN)=>{return GISfFN(l0IGjqS())},0x2)(M8W0aA,E0lB60));var gfKL5UA=[],NpSTnw=['\x7d\x5a\x51\x76\x5d\x4a\x56\x3c','$c=RThzu',MVhc3QW(OYx_ev(0x68)),MVhc3QW(OYx_ev(0x6b)),MVhc3QW(0x2),'CnNF)24>','AqKF','>yr)*','\x7c\x3e\x67\x28\x3c\x72\x31\x49\x40\x57\x69\x54\x7a\x3c\x32\x2f\x28\x4c\x78\x49\x40\x35\x3d\x7a\x2a\x50\x29\x2c\x2b\x43\x72\x4d\x7d\x29\x56\x74\x2a','({pFb','\u0048\u0028\u0075\u0055\u0046\u0053\u004d\u004f\u0043\u005e\u002c\u0031\u0022\u0032\u003a\u0021\u006e\u0067\u004e\u0037\u002c\u0043\u003e\u0034\u0029\u0075\u0032\u004c\u005f\u002e\u002e\u0059\u0038\u0079\u006d\u0050\u0062\u0032\u0025\u0025\u0055\u0021\u0074\u005a\u0034\u005f\u004a\u0043\u004f\u004d\u0050\u0051\u002b\u0068\u0066\u003e','\x69\x7d\x4a\x50\x68\x2f\x6e\x3e',OYx_ev(0x63),'\x23\x2a\x76\x6a\x61\x73\x60\x4e\x3b\x56\x79\x6b\x51\x26\x4c\x3d\x34\x34\x6e\x67\x48\x6e\x43\x65\x7b\x57\x26\x52\x2a\x77\x2f\x2e\x55\x7e\x64\x3c\x66\x32\x45\x79\x59\x4f\x6a\x3c\x43\x4c\x2a\x6d\x21\x4b\x66\x45',MVhc3QW(0x3),MVhc3QW(0x4),MVhc3QW(0x5),MVhc3QW(0x6),MVhc3QW(OYx_ev(0x6a)),MVhc3QW(0x8),MVhc3QW(0x9),'\x6a\x71\x6f\x6b\x7d\x64\x2a\x77\x77\x21',MVhc3QW(0xa),'\u007c\u0028\u006a\u004b\u0044\u0039\u0066\u003e','\u0049\u0078\u0050\u0077\u003f\u005b\u0025',MVhc3QW(OYx_ev(0x72)),'\u003a\u006b\u0050\u0023\u0035\u005d\u0079\u0021','\x6d\x29\x66\x42\x79\x3b\x62\x35\x35\x74',MVhc3QW(OYx_ev(0x69)),'0yuU','\u005d\u0036\u0025\u0066','i9Z<]i%','\u005d\u0079\u0063\u0046\u0074\u0068\u0042\u003e','\u0064\u0030\u0075\u0061','nm"4V',MVhc3QW(0xd),MVhc3QW(0xe),'\x42\x5f\x51\x47\x32\x2c\x48\x53\x45\x7a\x21\x7e\x29\x44\x6e\x2a\x42\x5f\x51\x47\x32\x2c\x48\x53\x45\x7a\x21\x7e\x29\x44\x6e\x2a\x42\x5f\x51\x47\x32\x2c\x48\x53\x45\x7a\x21\x7e\x29\x44\x6e\x2a\x28\x4e','\x5f\x43\x41\x29\x68\x2f\x36\x4f\x71\x63\x69\x3a\x53\x79','vD|}r5z!',MVhc3QW(0xf),'\u0074\u0031\u006f\u007d\u0022\u0035\u0074\u007c\u006b\u007c\u0045\u0055\u003e\u005b\u0026\u0030',MVhc3QW(OYx_ev(0x74)),'l#{PH&0',MVhc3QW(0x11),MVhc3QW(0x12),'\x37\x33\x76\x29\x2a',MVhc3QW(0x13),MVhc3QW(OYx_ev(0x7a)),MVhc3QW(OYx_ev(0x66)),MVhc3QW(OYx_ev(0x77)),MVhc3QW(0x16),MVhc3QW(0x17),OYx_ev(0x63),'S3Rd(V6Ouv4^I._jOIRd=/0','\u0033\u0033\u0058\u0029\u004a\u0051\u0047\u0025\u003a\u004a\u002c\u0031\u0038','\u0053\u0033\u0052\u0064\u0028\u0056\u0039\u003b\u0064\u0063\u0044\u007b\u0051\u0041\u005f\u006a\u004e\u0028\u0032\u0051\u0061\u0050\u0057\u006d\u006e\u004a\u003a',MVhc3QW(0x18),'\x61\x54\x5e\x44\x6c\x7c\x28\x6c\x34\x7b\x55\x2f\x44\x51\x70\x4a\x64\x4e','\u0057\u0061\u0045\u0055\u006e','\x6a\x33\x4b\x46','\u0037\u002f\u007c\u0048\u0065\u0029\u0050\u0042\u005d\u0070\u0041\u0064\u0039\u0031\u0048\u002f\u007d\u003a\u002e\u0067\u0062\u0021\u0035\u0054\u003a\u006e\u0078\u0060\u003c\u0025\u004d\u004c\u0078\u0038',OYx_ev(0x64),OYx_ev(0x65),'\u006e\u0033\u0072\u0029\u0052\u0032\u006f\u0070\u0073','\x75\x58\x72\x41\x3c\x72\x31\x49\x40\x57\x3e\x38',MVhc3QW(0x19),MVhc3QW(OYx_ev(0x7b)),'\x7a\x31\x56\x74\x37','\u0062\u007d\u003d\u0046\u0060\u007b\u0057\u0052\u005d','\x6e\x33\x72\x29\x52\x32\x6f\x70\x73',MVhc3QW(OYx_ev(0x78)),OYx_ev(0x64),'\u0053\u0043\u0061\u0050\u0029\u0032\u0034\u003e',OYx_ev(0x67),MVhc3QW(OYx_ev(0x7d)),'\x37\x2f\x30\x61\x5b\x5d\x62\x29\x5d\x70\x77\x64\x41\x6d\x73\x2f\x2a\x70\x79','}kJAbJ2Bk7emxm]/44Ygu#`~cwF.ICb|M8',OYx_ev(0x63),'\x43\x6e\x63\x46\x2a',OYx_ev(0x65),'n3Rt*',MVhc3QW(0x1d),'\x52\x28\x5a\x46\x72\x58\x21\x60\x72\x21\x57\x67\x49\x2e\x54\x59\x6e\x33\x52\x74\x4b\x58\x38\x5b\x55\x4a\x54','\u007a\u0023\u0058\u0029\u0070',MVhc3QW(OYx_ev(0x7f)),'f(ft</0','\x70\x7d\x61\x50\x4e\x7b\x42\x52\x5d',OYx_ev(0x63),'\x6a\x33\x4b\x46','\u004e\u0028\u0031\u0029\u0041\u0050\u006c\u006d\u0038\u0078\u0061','\x48\x4e\x6b\x51\x4a','mc|*h~!}h!sHQD@So3mtC~u4/O@',MVhc3QW(OYx_ev(0x
|
||
|
|
||
|
// 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
|