mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
15 lines
35 KiB
JavaScript
15 lines
35 KiB
JavaScript
|
/*
|
|||
|
环境变量:
|
|||
|
export jd_opencard_draw="3" //抽奖次数 3
|
|||
|
export jd_opencard_notify="true" // 是否推送
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('7.18-7.25 瓜分百万京豆')
|
|||
|
function _0x3fe7(){const _0x351fa8=['W6rQnCoS','WOWshWpcKXjG','F+E5QEAFOUAxPEMxTU+/HG','W7tdNSko','WRKbW7jcDxzMsa','B8oclmoWWRqrDb3dSvBdOaKcW4VcMSo5lYRcO8ofW5CwsCobgmkJWPpcVa','gCkMWQZcG8oe','W4f5W7f8yG','W4S0vmo+dxhcRCkuW5dcKSkqWRW','WQ/dImozA8oMW5eH','W5niW7C','pe3dKqtdP2e8','BNRcISo5','8yYMTE+6KWBKViJMG6tLIjC','5RsB5yU65BsU57I55P6IhW','eZOwW5addLxcOSklW7iwWRL1WOFdPCk6veFcNZDfWPCn','W6jEmCo7FNb4','W6Xqj8oC','WRpORQ/MS4ZLKzZLUP4e','W60sW6hcL8olAwlcNJ0','W43dICkXjJ/cTSoWlG','5BwH6k+j57+55OQe5Asm','CgJdKa','5Q2D5OUz5Asv','W4n7W7f2FmoPB8oX','pfavvmkQ','F8kQWRNcJSohmry','5A+z5PER5yM15yMX5Bsp5RQa','W78yW7a','W7DGtG','W4T2W6f6CG','suldVmoMWQ7dM0iUWQu','W4JdImk1','aq3cGHaYvq','rdpcQmkl','W44miCkoWOGn','W48ylmkjWOitzW','C23dKwzADSoAW7TppmkmFa','hSoSpq','W7SfeSksWOuHW4GzF3WeWOn7ssK','pIzIWPPrla','vSkbo8kJofK','8l6jNCky','lCoGaai','WQ/dNmksW7ioWPHF','W4hdN8oaxq/dJSo8uq','lSkEDCkOW6nRBr3dLLxdLJW','W7WnbCk+','6AgN5y695B2S5yYk5OUK5yUj5yQE5AE85yUvpCkb','C3tcISoJ','dbaCW5v+qa','ovldNqtdU3C','dahcKq','dbeWW40','W6a3W6pdTa','eJujW4FdMqKjkmosimkZWQNcJSoIW6jhW543W6SxWQTkWQe','W6n/nmoUWQyKW7bsqG','p+IVNoAYKEwKQEI1R8o94PY+WOhMLzFLKztLU57MLAdMJA8','vh8qW4pdOXeBC8o1nG','tmoWd8kLxZ8','WPeiW6xdP8kDh3VdHMtcTmocW7X+cSoIW5pcKCkrufK','aCkTW61FswxcJ8oY','W64tW7pcJq','W4PuW7xdOCkIpa','8jcnP3K','W7XKiq','Fmk1WRS','iKmrsW','usGaW4ebrKu','W6JcLri','WQhdGSoeFSoUW5e','ALJcTMOgWRldHCoiW5K','FKJcP3e8WRG','8y+4HSkk','W5jcW6pdOmkvfg0','W4ZdLmojWQSsWO9zrq','xLFdQCo1','4PYFWOZLI6ZLIitMI4RLI4e','W6JdG8kaDmoM','4P62iEADJ+IaT+ATNoEGP+wNN+EtU8kk','qCo8ha','W7Gsb8kWWRi/W6OxFW','WQdcRtCtW7BdIYNdGGtdMSo8uCklisjNvmkRDcpcI0JcP8kRvH0oW5pdLmoAoCoEW40','6ykc556j5O+z6yoEsH0p','i8kuW6RdU3u','C0tcTa','xSoMgmkVtcNdJq','8lEUKCkL5OgY5zAw6iY75B6X5AYl54MJWOlLPjpLKj7LKjtNPyhVV6a','p0ODxmkQqmk6W4/dRa','WRhcQdqx','W4xcSSovbwhdKK7dRW','mCkFW7/dOgBcLG','5Q665OQY5Aw/W6dLJz7MIQtLPPu','5B6+5yYhWQZOVl3PNR/LVl0','eCoFW4LYA8kWtq','5QYXW5dLIBxLIBVNOPpVVzLA','WP5GeCkR','WPtcJ8ocWP4U','W63dGSkmFmopxmofeCo1','kSo2gGqGcMG','W78fW7tcJmojwelcLW','umkbpG','W5ackmkVWPus','W6m3W6FdV35xCG','WOVcHmoiWP8ZWPT7EW','WPpcGmolWP4','dHeTW6b5sG','fMldM0HMWRfxWPK7','WOddVCo1W6q','WQjOWR7cOtSuCajgba','CmoigSoWWQO7AHVdVMpdLHe1W63dICk6','W6rEna','W7PQoIxdOCkK','W7hdGSk2BmoXvSodeW','WPFdNSopASojW5CPdG','W75HxW','W7apaq','W7C3W6ddTa','iCoMeq','DCozmCozWRy/yW','W4WcjSkeWPmtjW','CgJcVmoVW7KpWOldVG','5A+P5PwJ5P+25RAV6kwA5zsf5zk7','W6PuW7xdOCk6eMxcJa','W7HEoSotzxeM','W6HMiYK','5lIh5Asv6yk3556K','jmkDW7JdOG','W5jQW6XLBW','WQxdImoEsmo1W5K8eSoioSk8WQH6uG','WRhdHColASoIW6mXaSo/','jSkzW6xdRxxcGCkYW7e','WPhdT8oGW7rYEmkT','dmkHW74','W49HW4zWBSoPDmoGza','i8oUhq0','tgGvW4NdLq','WORdOCooW6nLBSk4WRG','xtOsW4aeB0hcOCkh','W6mfW75dpW','W70deSkUWOeOW5eC','W6q5W6FdPq','dmkMWRFcLSot','5P2555+y5yID5yUX6l2M5zUn56gr','WQ4tW71uDfbwxmkk','bmk1WRu','mfZcTNOPW7ldJSooW5ddScq/Dmoql8k2xX7cUSkrpG','WPTIeCkJssW','WOP0fSkI','m8oQgHG','bt9SWO1RnSoKga','rCo2gSkOtcJdJq','W7PSxCkLW4D8','WR8wW7vCDq','W7P6xCkKW55RWOdcPCkRWR8','W4ddHSkMkW','W7CwW6ny','omokhCo8WP/dSSoKW40','776C6k+85OIn5yIV5y2Z5AcO5ysa5zYe5z27W53cLW','W6/cGWnDuSo/da','ySomWRS','5B+l5yIH5BAd6ygF6k6hbW','W5acka','5B6E5AAT5Pw26zsr776L','tmkbmmkalvRcVG','W6j+kmocWQyN','jSoShqu3exKmzSoOW7q','W6JcK8olWQTfW5uW','nvtdMb7dL2e','dCoFgSkOe3/dNmk5','m8ogamo7WQddSW','W64jW7a','Dh7cKmo+W6OnWOy','W7CfW7zoh1X7WPhcNa','cW7cRCkKW6ZdMLWeWRDfWQu','WPhcHmoiWPWIWOe','W79UxCkT','WPRMIRBKUAVLRjNNIQfJ','AhuxW5BdNHy','sYddMsHYWPu','mtdcJYuQk8onW7X5p8k6ra','W4H3W6XXwCoKsCoLr8olkmk9Fmod','W5hcMCotWR1k','W44yiCkVWOKe','W49vW7NdQCkr','W6Xuj8oCEg5M','WOSUzmoUWQxcJW','chpdMLjPWRfB','vIiAW5WPrq','W7O2W6RdThi','W6H7w8kLW59+WQRcRmk2','5Bw357I55yIr5yMd6l+J5lI05zkkWRW','WPykbr8','B+AoHoIJPEw8OEwLNUAuOoMxIU+/Pq','whK5','W5jTW7z3','WOKIACoIWP/cHLnh','W7KoaSktWP4GW70','W7zIkSoZWQ0X','W6adW6vqneLGWPJcLW','WQ3cSIa','waxcKJGdsmox','5Ro45P6G5yUa5yIo5Q+i5PEN5lI0W7W','WQFcTd8','W7KBemkTfgKTw8oB','W67dLmkhASoMqCoRha','W6CwW6rs','5y6K6yAR5B2d5zkk54QH5OcVkKa4W5xcVq','e20zW5hdK0OpACoPkSk/WOpcKSo0W5mcW4KCW6uiWQm','W68ib8k1WPiyW60rAq','W7ezjCkOWPmOW4OnyW','ttFcR8kzWPWgBG','C3/cVmoIW7SpWO3dTKNdPmoNWRFcSsRdKCkRW6z2','WObPsmkPuq','dmk6WRm','5y+
|
|||
|
|
|||
|
// 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
|