Best JavaScript code snippet using storybook-root
jd_xyc.js
Source:jd_xyc.js
1/*20 8,12 * * * jd_xyc.js3å
¥å£ï¼äº¬ä¸ -> 京ä¸ä¼ç¹é¢é4*/5const $ = new Env('æ 檬ä¼ç¹è®¸æ¿æ± ');6const notify = $.isNode() ? require("./sendNotify") : "";7const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";8let timestamp = Date.now();9let cookiesArr = [], cookie = "", message;10a = ''11let allMessage = '';12if ($.isNode()) {13 Object.keys(jdCookieNode).forEach((item) => {14 cookiesArr.push(jdCookieNode[item])15 })16 if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { };17} else {18 cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);19}20!(async () => {21 if (!cookiesArr[0]) {22 $.msg($.name, 'ãæ示ã请å
è·å京ä¸è´¦å·ä¸cookie\nç´æ¥ä½¿ç¨NobyDaç京ä¸ç¾å°è·å', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });23 return;24 }25 for (let i = 0; i < cookiesArr.length; i++) {26 if (cookiesArr[i]) {27 cookie = cookiesArr[i];28 ck2 = cookiesArr[Math.round(Math.random() * cookiesArr.length)];29 $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);30 $.index = i + 1;31 message = "";32 console.log(`\n******å¼å§ã京ä¸è´¦å·${$.index}ã${$.UserName}*********\n`);33 await task()34 }35 }36 // if ($.isNode() && allMessage) {37 // await notify.sendNotify(`${$.name}`, `${allMessage}`)38 // }39})()40 .catch((e) => {41 $.log("", `â ${$.name}, 失败! åå : ${e}!`, "");42 })43 .finally(() => {44 $.done();45 });46function task() {47 return new Promise(async (resolve) => {48 let options = {49 url: `https://api.m.jd.com/client.action`,50 body: `functionId=healthyDay_getHomeData&body={"appId":"1E1NXxq0","taskToken":"","channelId":1}&client=wh5&clientVersion=1.0.0`,51 headers: {52 "Origin": "https://h5.jd.com",53 "Host": "api.m.jd.com",54 "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 UBrowser/5.6.12150.8 Safari/537.36",55 "Cookie": cookie,56 }57 }58 $.post(options, async (err, resp, data) => {59 try {60 data = JSON.parse(data);61 if (data.data.bizMsg == "success") {62 $.log(`===============åè´§éå¸===============`)63 $.log(`${data.data.result.userInfo.userScore}å¸`)64 userScore = data.data.result.userInfo.userScore65 $.log(`===============æ½å¥éè¦===============`)66 $.log(`${data.data.result.userInfo.scorePerLottery}å¸`)67 scorePerLottery = data.data.result.userInfo.scorePerLottery68 tasklist = data.data.result.taskVos69 $.log(`===============å»åä»»å¡===============`)70 $.log(`===============æµè§å¹¶å
³æ³¨ä¼ç¹é¢é===============`)71 tk = tasklist[0].shoppingActivityVos[0].taskToken72 taskId = tasklist[0].taskId73 await dotask(tk, taskId, 0)74 await dotask(tk, taskId, 1)75 await dotask(tk, taskId, 0)76 $.log(`===============æµè§ä¼ç¹é¢é===============`)77 tk = tasklist[1].shoppingActivityVos[0].taskToken78 taskId = tasklist[1].taskId79 await dotask(tk, taskId, 0)80 await dotask(tk, taskId, 1)81 await $.wait(15000)82 await dotask(tk, taskId, 0)83 $.log(`===============æ¯æµè§åå10så¯è·å¾200éå¸===============`)84 tk = tasklist[2].productInfoVos[0].taskToken85 taskId = tasklist[2].taskId86 item = tasklist[2].productInfoVos[0].itemId87 await dotask(tk, taskId, 0, item)88 await dotask(tk, taskId, 1, item)89 await $.wait(11000)90 await dotask(tk, taskId, 0, item)91 tk = tasklist[2].productInfoVos[1].taskToken92 taskId = tasklist[2].taskId93 item = tasklist[2].productInfoVos[1].itemId94 await dotask(tk, taskId, 0, item)95 await dotask(tk, taskId, 1, item)96 await $.wait(11000)97 await dotask(tk, taskId, 0, item)98 tk = tasklist[2].productInfoVos[2].taskToken99 taskId = tasklist[2].taskId100 item = tasklist[2].productInfoVos[2].itemId101 await dotask(tk, taskId, 0, item)102 await dotask(tk, taskId, 1, item)103 await $.wait(11000)104 await dotask(tk, taskId, 0, item)105 tk = tasklist[2].productInfoVos[3].taskToken106 item = tasklist[2].productInfoVos[3].itemId107 taskId = tasklist[2].taskId108 await dotask(tk, taskId, 0, item)109 await dotask(tk, taskId, 1, item)110 await $.wait(11000)111 await dotask(tk, taskId, 0, item)112 tk = tasklist[2].productInfoVos[4].taskToken113 item = tasklist[2].productInfoVos[4].itemId114 taskId = tasklist[2].taskId115 await dotask(tk, taskId, 0, item)116 await dotask(tk, taskId, 1, item)117 await $.wait(11000)118 await dotask(tk, taskId, 0, item)119 $.log(`===============é请ä¸ä¸ªå¥½åå©åå¯è·å¾300éå¸===============`)120 tk = tasklist[3].assistTaskDetailVo.taskToken121 taskId = tasklist[3].taskId122 yqm = tasklist[3].assistTaskDetailVo.itemId123 $.log(`é请ç ${yqm}\næ£å¨åéæºCKäºç¸å©å3次`)124 for (let i = 0; i < 5; i++) {125 ck2 = cookiesArr[Math.round(Math.random() * cookiesArr.length)];126 await help(tk, taskId, 0, yqm)127 await help(tk, taskId, 1, yqm)128 await help(tk, taskId, 0, yqm)129 }130 $.log(`===============å
³æ³¨åºéºå¯è·å¾200éå¸===============`)131 tk = tasklist[4].followShopVo[0].taskToken132 item = tasklist[4].followShopVo[0].itemId133 taskId = tasklist[4].taskId134 await dotask(tk, taskId, 0, item)135 await dotask(tk, taskId, 1, item)136 await dotask(tk, taskId, 0, item)137 tk = tasklist[4].followShopVo[1].taskToken138 item = tasklist[4].followShopVo[1].itemId139 taskId = tasklist[4].taskId140 await dotask(tk, taskId, 0, item)141 await dotask(tk, taskId, 1, item)142 await dotask(tk, taskId, 0, item)143 tk = tasklist[4].followShopVo[2].taskToken144 item = tasklist[4].followShopVo[2].itemId145 taskId = tasklist[4].taskId146 await dotask(tk, taskId, 0, item)147 await dotask(tk, taskId, 1, item)148 await dotask(tk, taskId, 0, item)149 $.log(`===============è¿ç»ç¾å°===============`)150 tk = tasklist[5].simpleRecordInfoVo.taskToken151 item = tasklist[5].simpleRecordInfoVo.itemId152 taskId = tasklist[5].taskId153 await dotask(tk, taskId, 0, item)154 await dotask(tk, taskId, 1, item)155 await dotask(tk, taskId, 0, item)156 await getLottery()157 cj = $.userScore / 500158 cj = parseInt(cj)159 if (cj > 0) {160 for (let i = 0; i < cj; i++) {161 await getLottery()162 }163 }164 } else if (data.data.bizMsg !== "success") {165 console.log(data.msg)166 }167 } catch (e) {168 $.logErr(e, resp);169 } finally {170 resolve();171 }172 });173 });174}175function help(taskToken, taskId, actionType, itemId) {176 return new Promise(async (resolve) => {177 let options = {178 url: `https://api.m.jd.com/client.action`,179 body: `functionId=harmony_collectScore&body={"appId":"1E1NXxq0","taskToken":"${taskToken}","taskId":${taskId},"itemId":"${itemId}","actionType":${actionType}}&client=wh5&clientVersion=1.0.0`,180 headers: {181 "Origin": "https://h5.jd.com",182 "Host": "api.m.jd.com",183 "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 UBrowser/5.6.12150.8 Safari/537.36",184 "Cookie": ck2,185 }186 }187 $.post(options, async (err, resp, data) => {188 try {189 data = JSON.parse(data);190 if (data.data.bizMsg == "success") {191 $.log(`===============ä»»å¡å®æ===============`)192 console.log(data.data.bizMsg)193 $.log(`è·å¾${data.data.result.userScore}`)194 } else if (data.data.bizMsg !== "success") {195 console.log(data.data.bizMsg)196 }197 } catch (e) {198 $.logErr(e, resp);199 } finally {200 resolve();201 }202 });203 });204}205function dotask(taskToken, taskId, actionType, itemId) {206 return new Promise(async (resolve) => {207 let options = {208 url: `https://api.m.jd.com/client.action`,209 body: `functionId=harmony_collectScore&body={"appId":"1E1NXxq0","taskToken":"${taskToken}","taskId":${taskId},"itemId":"${itemId}","actionType":${actionType}}&client=wh5&clientVersion=1.0.0`,210 headers: {211 "Origin": "https://h5.jd.com",212 "Host": "api.m.jd.com",213 "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 UBrowser/5.6.12150.8 Safari/537.36",214 "Cookie": cookie,215 }216 }217 $.post(options, async (err, resp, data) => {218 try {219 data = JSON.parse(data);220 if (data.data.bizMsg == "success") {221 $.log(`===============ä»»å¡å®æ===============`)222 console.log(data.data.bizMsg)223 $.log(`è·å¾${data.data.result.userScore}`)224 } else if (data.data.bizMsg !== "success") {225 console.log(data.data.bizMsg)226 }227 } catch (e) {228 $.logErr(e, resp);229 } finally {230 resolve();231 }232 });233 });234}235function getLottery() {236 return new Promise(async (resolve) => {237 let options = {238 url: `https://api.m.jd.com/client.action`,239 body: `functionId=interact_template_getLotteryResult&body={"appId":"1E1NXxq0"}&client=wh5&clientVersion=1.0.0`,240 headers: {241 "Origin": "https://h5.jd.com",242 "Host": "api.m.jd.com",243 "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 UBrowser/5.6.12150.8 Safari/537.36",244 "Cookie": cookie,245 }246 }247 $.post(options, async (err, resp, data) => {248 try {249 data = JSON.parse(data);250 if (data.data.bizMsg == "success") {251 $.userScore = data.data.result.userScore252 $.bizMsg = data.data.bizMsg253 $.log(`===============å¼å§æ½å¥===============`)254 if (data.data.result.userAwardsCacheDto.jBeanAwardVo) {255 $.log(data.data.result.userAwardsCacheDto.jBeanAwardVo.prizeName)256 allMessage += `京ä¸è´¦å·${$.index}-${$.nickName || $.UserName}\næ½å¥äº¬è±: ${data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity}${$.index !== cookiesArr.length ? '\n\n' : '\n\n'}`;257 } else258 $.log(`å¥é½æ²¡æ½å°`)259 } else if (data.data.bizMsg !== "success") {260 console.log(data.data.bizMsg)261 }262 } catch (e) {263 $.logErr(e, resp);264 } finally {265 resolve();266 }267 });268 });269}270function jsonParse(str) {271 if (typeof str == "string") {272 try {273 return JSON.parse(str);274 } catch (e) {275 console.log(e);276 $.msg($.name, "", "ä¸è¦å¨BoxJSæå¨å¤å¶ç²è´´ä¿®æ¹cookie");277 return [];278 }279 }280}281function Env(t, e) {282 class s {283 constructor(t) {284 this.env = t285 }286 send(t, e = "GET") {287 t = "string" == typeof t ? {288 url: t289 } : t;290 let s = this.get;291 return "POST" === e && (s = this.post), new Promise((e, i) => {292 s.call(this, t, (t, s, r) => {293 t ? i(t) : e(s)294 })295 })296 }297 get(t) {298 return this.send.call(this.env, t)299 }300 post(t) {301 return this.send.call(this.env, t, "POST")302 }303 }304 return new class {305 constructor(t, e) {306 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("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`)307 }308 isNode() {309 return "undefined" != typeof module && !!module.exports310 }311 isQuanX() {312 return "undefined" != typeof $task313 }314 isSurge() {315 return "undefined" != typeof $httpClient && "undefined" == typeof $loon316 }317 isLoon() {318 return "undefined" != typeof $loon319 }320 toObj(t, e = null) {321 try {322 return JSON.parse(t)323 } catch {324 return e325 }326 }327 toStr(t, e = null) {328 try {329 return JSON.stringify(t)330 } catch {331 return e332 }333 }334 getjson(t, e) {335 let s = e;336 const i = this.getdata(t);337 if (i) try {338 s = JSON.parse(this.getdata(t))339 } catch {340 }341 return s342 }343 setjson(t, e) {344 try {345 return this.setdata(JSON.stringify(t), e)346 } catch {347 return !1348 }349 }350 getScript(t) {351 return new Promise(e => {352 this.get({353 url: t354 }, (t, s, i) => e(i))355 })356 }357 runScript(t, e) {358 return new Promise(s => {359 let i = this.getdata("@chavy_boxjs_userCfgs.httpapi");360 i = i ? i.replace(/\n/g, "").trim() : i;361 let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");362 r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r;363 const [o, h] = i.split("@"), a = {364 url: `http://${h}/v1/scripting/evaluate`,365 body: {366 script_text: t,367 mock_type: "cron",368 timeout: r369 },370 headers: {371 "X-Key": o,372 Accept: "*/*"373 }374 };375 this.post(a, (t, e, i) => s(i))376 }).catch(t => this.logErr(t))377 }378 loaddata() {379 if (!this.isNode()) return {};380 {381 this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");382 const t = this.path.resolve(this.dataFile),383 e = this.path.resolve(process.cwd(), this.dataFile),384 s = this.fs.existsSync(t),385 i = !s && this.fs.existsSync(e);386 if (!s && !i) return {};387 {388 const i = s ? t : e;389 try {390 return JSON.parse(this.fs.readFileSync(i))391 } catch (t) {392 return {}393 }394 }395 }396 }397 writedata() {398 if (this.isNode()) {399 this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");400 const t = this.path.resolve(this.dataFile),401 e = this.path.resolve(process.cwd(), this.dataFile),402 s = this.fs.existsSync(t),403 i = !s && this.fs.existsSync(e),404 r = JSON.stringify(this.data);405 s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r)406 }407 }408 lodash_get(t, e, s) {409 const i = e.replace(/\[(\d+)\]/g, ".$1").split(".");410 let r = t;411 for (const t of i)412 if (r = Object(r)[t], void 0 === r) return s;413 return r414 }415 lodash_set(t, e, s) {416 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)417 }418 getdata(t) {419 let e = this.getval(t);420 if (/^@/.test(t)) {421 const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : "";422 if (r) try {423 const t = JSON.parse(r);424 e = t ? this.lodash_get(t, i, "") : e425 } catch (t) {426 e = ""427 }428 }429 return e430 }431 setdata(t, e) {432 let s = !1;433 if (/^@/.test(e)) {434 const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i),435 h = i ? "null" === o ? null : o || "{}" : "{}";436 try {437 const e = JSON.parse(h);438 this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i)439 } catch (e) {440 const o = {};441 this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i)442 }443 } else s = this.setval(t, e);444 return s445 }446 getval(t) {447 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.data[t] || null448 }449 setval(t, e) {450 return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null451 }452 initGotEnv(t) {453 this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))454 }455 get(t, e = (() => {456 })) {457 t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {458 "X-Surge-Skip-Scripting": !1459 })), $httpClient.get(t, (t, s, i) => {460 !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)461 })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {462 hints: !1463 })), $task.fetch(t).then(t => {464 const {465 statusCode: s,466 statusCode: i,467 headers: r,468 body: o469 } = t;470 e(null, {471 status: s,472 statusCode: i,473 headers: r,474 body: o475 }, o)476 }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => {477 try {478 if (t.headers["set-cookie"]) {479 const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();480 this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar481 }482 } catch (t) {483 this.logErr(t)484 }485 }).then(t => {486 const {487 statusCode: s,488 statusCode: i,489 headers: r,490 body: o491 } = t;492 e(null, {493 status: s,494 statusCode: i,495 headers: r,496 body: o497 }, o)498 }, t => {499 const {500 message: s,501 response: i502 } = t;503 e(s, i, i && i.body)504 }))505 }506 post(t, e = (() => {507 })) {508 if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, {509 "X-Surge-Skip-Scripting": !1510 })), $httpClient.post(t, (t, s, i) => {511 !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i)512 });513 else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, {514 hints: !1515 })), $task.fetch(t).then(t => {516 const {517 statusCode: s,518 statusCode: i,519 headers: r,520 body: o521 } = t;522 e(null, {523 status: s,524 statusCode: i,525 headers: r,526 body: o527 }, o)528 }, t => e(t));529 else if (this.isNode()) {530 this.initGotEnv(t);531 const {532 url: s,533 ...i534 } = t;535 this.got.post(s, i).then(t => {536 const {537 statusCode: s,538 statusCode: i,539 headers: r,540 body: o541 } = t;542 e(null, {543 status: s,544 statusCode: i,545 headers: r,546 body: o547 }, o)548 }, t => {549 const {550 message: s,551 response: i552 } = t;553 e(s, i, i && i.body)554 })555 }556 }557 time(t) {558 let e = {559 "M+": (new Date).getMonth() + 1,560 "d+": (new Date).getDate(),561 "H+": (new Date).getHours(),562 "m+": (new Date).getMinutes(),563 "s+": (new Date).getSeconds(),564 "q+": Math.floor(((new Date).getMonth() + 3) / 3),565 S: (new Date).getMilliseconds()566 };567 /(y+)/.test(t) && (t = t.replace(RegExp.$1, ((new Date).getFullYear() + "").substr(4 - RegExp.$1.length)));568 for (let s in e) new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length)));569 return t570 }571 msg(e = t, s = "", i = "", r) {572 const o = t => {573 if (!t) return t;574 if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? {575 "open-url": t576 } : this.isSurge() ? {577 url: t578 } : void 0;579 if ("object" == typeof t) {580 if (this.isLoon()) {581 let e = t.openUrl || t.url || t["open-url"],582 s = t.mediaUrl || t["media-url"];583 return {584 openUrl: e,585 mediaUrl: s586 }587 }588 if (this.isQuanX()) {589 let e = t["open-url"] || t.url || t.openUrl,590 s = t["media-url"] || t.mediaUrl;591 return {592 "open-url": e,593 "media-url": s594 }595 }596 if (this.isSurge()) {597 let e = t.url || t.openUrl || t["open-url"];598 return {599 url: e600 }601 }602 }603 };604 this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r)));605 let h = ["", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];606 h.push(e), s && h.push(s), i && h.push(i), console.log(h.join("\n")), this.logs = this.logs.concat(h)607 }608 log(...t) {609 t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator))610 }611 logErr(t, e) {612 const s = !this.isSurge() && !this.isQuanX() && !this.isLoon();613 s ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t)614 }615 wait(t) {616 return new Promise(e => setTimeout(e, t))617 }618 done(t = {}) {619 const e = (new Date).getTime(),620 s = (e - this.startTime) / 1e3;621 this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)622 }623 }(t, e)...
unicom.js
Source:unicom.js
...16 init17 }18 // æ¯æ¥ç¾å°ç§¯å19 await scheduler.regTask('dailysignin', async (request) => {20 await require('./dailysignin').doTask(request, options)21 await require('./integral').addFlow(request, options)22 }, taskOption)23 // å¬å¥¥ç§¯åæ´»å¨ 2020123124 await scheduler.regTask('winterTwo', async (request) => {25 await require('./integral').winterTwoGetIntegral(request, options)26 await require('./integral').winterTwoStatus(request, options)27 }, taskOption)28 // æ¯æ¥å®å积å 2020123129 await scheduler.regTask('dxIntegralEveryDay', async (request) => {30 await require('./integral').dxIntegralEveryDay(request, options)31 }, taskOption)32 // æ¯æ¥æ¸¸æ楼å±å®ç®±33 await scheduler.regTask('dailygamebox', async (request) => {34 await require('./integral').gamebox(request, options)35 }, taskOption)36 // é¦é¡µ-积ååå-å®å积åä¸åº-æ¯æ¥æ½å¥(1次å
è´¹å5次è±è´¹å®å积åæ½å¥)37 await scheduler.regTask('dailylotteryintegral', async (request) => {38 await require('./dailyShop').dailyintegrallottery(request, options)39 }, taskOption)40 // é¦é¡µ-游æ-娱ä¹ä¸å¿-æ²ä¹æ 41 await scheduler.regTask('dailywoTree', async (request) => {42 await require('./woTree').doTask(request, options)43 }, taskOption)44 await scheduler.regTask('dailyBookRead', async (request) => {45 // é¦é¡µ-å°è¯´-é
读è¶æ礼æå¡èµ¢è¯è´¹46 await require('./dailyBookRead').doTask(request, options)47 await require('./dailyVideoBook').doTask(request, options)48 }, taskOption)49 // é¦é¡µ-å°è¯´-ä¼åæ¥æ´»å¨-ç¾å°æ½å¤§å¥50 await scheduler.regTask('dailyBookMemberDay', async (request) => {51 await require('./dailyBookRead').dovideoIntegralTask(request, options)52 await require('./dailyBookRead').doMemberDaySign(request, options)53 }, taskOption)54 // é¦é¡µ-å°è¯´-é
读ç°é红å
é¨-çè§é¢å¾ç§¯å55 await scheduler.regTask('dailyRedbagRainVideoIntegral', async (request) => {56 // çè§é¢å¾ç§¯å57 await require('./dailyRedbagRain').dovideoIntegralTask(request, options)58 }, taskOption)59 // é¦é¡µ-å°è¯´-é
读ç°é红å
é¨60 // æ´»å¨å·²ä¸çº¿61 // await scheduler.regTask('dailyRedbagRain', async (request) => {62 // // çè§é¢å¾ç§¯å63 // await require('./dailyRedbagRain').getRedBag(request, options)64 // }, {65 // ...taskOption,66 // startTime: 20 * 3600 - 10 * 55,67 // ignoreRelay: true68 // })69 // é¦é¡µ-å°è¯´-读满10ç« èµ¢å¥½ç¤¼70 await scheduler.regTask('dailyBookRead10doDraw', async (request) => {71 // é¦é¡µ-å°è¯´-读满10ç« èµ¢å¥½ç¤¼72 await require('./dailyVideoBook').read10doDraw(request, options)73 // é¦é¡µ-ç¾å°æ礼-å
æµéå¾ç¦å©-3积å天天æ¿(é
读æå¡) å·²ä¸çº¿74 // await require('./dailyVideoBook').giftBoints(request, options)75 }, taskOption)76 // é¦é¡µ-å°è¯´-ç« è详æ
-çè§é¢é¢ç§¯å77 await scheduler.regTask('dailyBookVideo', async (request) => {78 // é¦é¡µ-å°è¯´-读满10ç« èµ¢å¥½ç¤¼-çè§é¢é¢2积å79 await require('./dailyVideoBook').dovideoIntegralTask(request, options)80 // é¦é¡µ-å°è¯´-ç« è详æ
-çè§é¢é¢ç§¯å81 await require('./dailyBookVideo').doTask(request, options)82 }, taskOption)83 await scheduler.regTask('dailyBookLuckdraw', async (request) => {84 // é¦é¡µ-å°è¯´-é
读ç¦å©æ½å¤§å¥85 await require('./dailyBookLuckdraw').doTask(request, options)86 }, taskOption)87 // é¦é¡µ-ç¾å°æ礼-å
è´¹é¢-1Gæµéæ¥å
88 await scheduler.regTask('daily1GFlowTask', async (request) => {89 await require('./daily1GFlowTask').doTask(request, options)90 }, {91 ...taskOption,92 startTime: 20 * 3600,93 ignoreRelay: true94 })95 // é¦é¡µ-ç¾å°æ礼-å
è´¹é¢-æµè§é¢ç§¯å96 await scheduler.regTask('dailyLiuLan', async (request) => {97 await require('./dailyTTliulan').doTask(request, options)98 }, taskOption)99 // é¦é¡µ-ç¾å°æ礼-å
è´¹é¢-é¢å
è´¹é¸çé¤100 await scheduler.regTask('dailyScratchCard', async (request) => {101 await require('./dailyScratchCard').doTask(request, options)102 }, taskOption)103 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ¿-çè§é¢å¤ºå®104 // æåºç°æ¬æ¬¡æä½éè¦è¿è¡éªè¯ï¼ææ¶æ³¨é105 // await scheduler.regTask('dailyVideoFreeGoods', async (request) => {106 // await require('./dailyVideoFreeGoods').doTask(request, options)107 // }, {108 // isCircle: true,109 // startTime: 10 * 3600,110 // intervalTime: 4 * 3600111 // })112 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-èµ¢vivo x60113 await scheduler.regTask('dailyNcow', async (request) => {114 await require('./dailyNcow').doTask(request, options)115 }, taskOption)116 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-æ¿çº¢ç±³ç¬è®°æ¬-æ¥å
å®117 await scheduler.regTask('dailyIngots', async (request) => {118 await require('./dailyIngots').doTask(request, options)119 }, taskOption)120 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-æOPPOææº121 await scheduler.regTask('dailyGrabdollPage', async (request) => {122 await require('./dailyGrabdollPage').doTask(request, options)123 }, taskOption)124 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-æ¿666积å-豪礼大派éæ½å¥125 await scheduler.regTask('jflottery', async (request) => {126 await require('./jflottery').timesDraw(request, options)127 }, taskOption)128 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-æ¿è¹æiPad Pro(æä¸æ)129 await scheduler.regTask('dailyYYY', async (request) => {130 await require('./dailyYYY').doTask(request, options)131 }, taskOption)132 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-å为mate40pro(å®å®ä¹)133 await scheduler.regTask('dailyVideoScratchcard', async (request) => {134 await require('./dailyVideoScratchcard').doTask(request, options)135 }, taskOption)136 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-èµ¢ä¸æGalaxy Z(è¯è¯ææ°)137 // æ´»å¨å·²ä¸çº¿138 // await scheduler.regTask('dailyCheapStorePage', async (request) => {139 // await require('./dailyCheapStorePage').doTask(request, options)140 // }, {141 // isCircle: true,142 // intervalTime: 4 * 3600,143 // ...taskOption144 // })145 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-æå为Pad(å»æ½å¥)146 await scheduler.regTask('dailyLKMH', async (request) => {147 await require('./dailyLKMH').doTask(request, options)148 }, taskOption)149 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-æ¿iPhone12(æä¸æ)150 await scheduler.regTask('dailyYYQ', async (request) => {151 await require('./dailyYYQ').doTask(request, options)152 }, taskOption)153 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ½-èµ¢Apple Watch(å»æ½å¥)154 // 游æå·²ä¸çº¿155 // await scheduler.regTask('dailyTurntablePage', async (request) => {156 // await require('./dailyTurntablePage').doTask(request, options)157 // }, taskOption)158 // é¦é¡µ-ç¾å°æ礼-èµæ´å¤ç¦å©-çè§é¢å¥å±5积å159 await scheduler.regTask('dailyVideo', async (request) => {160 await require('./dailyVideo').doTask(request, options)161 }, taskOption)162 // é¦é¡µ-ç¾å°æ礼-èµæ´å¤ç¦å©-天天æ½å¥½ç¤¼163 await scheduler.regTask('dailylottery', async (request) => {164 await require('./dailylottery').doTask(request, options)165 }, taskOption)166 // é¦é¡µ-游æ-娱ä¹ä¸å¿-æ¯æ¥æå¡167 await scheduler.regTask('producGameSignin', async (request) => {168 await require('./producGame').gameBox(request, options)169 await require('./producGame').gameSignin(request, options)170 }, taskOption)171 // é¦é¡µ-游æ-娱ä¹ä¸å¿-天天é¢å3Gæµéå
172 await scheduler.regTask('dailygameflow', async (request) => {173 await require('./producGame').doGameFlowTask(request, options)174 }, taskOption)175 // é¦é¡µ-积åæ¥è¯¢-游æä»»å¡176 await scheduler.regTask('dailygameIntegral', async (request) => {177 await require('./producGame').doGameIntegralTask(request, options)178 }, taskOption)179 // é¦é¡µ-ç¥è¯-éæ¶å
è´¹ï¼è¿ç»7天é¶æ¢¯æ¿å±ï¼180 await scheduler.regTask('dailyCourse', async (request) => {181 await require('./dailyCourse').doTask(request, options)182 }, {183 ...taskOption,184 startTime: 9 * 3600185 })186 // await require('./integral').getflDetail(request, options)187 // await require('./integral').getTxDetail(request, options)188 // await require('./integral').getDxDetail(request, options)189 // await require('./integral').getCoins(request, options)190 // æ¯æ¥è¯è®ºç§¯å191 await scheduler.regTask('dailycomment', async (request) => {192 await require('./commentSystem').commentTask(request, options)193 }, taskOption)194 // é¦é¡µ-游æ-娱ä¹ä¸å¿-æ¯æ¥æå¡-å®æä»æ¥ä»»å¡(200m)195 await scheduler.regTask('todayDailyTask', async (request) => {196 await require('./producGame').gameBox(request, options)197 await require('./producGame').doTodayDailyTask(request, options)198 }, {199 ...taskOption,200 startTime: 22 * 3600201 })202 // é¦é¡µ-ç¾å°æ礼-å±
家娱ä¹é¦203 // æ´»å¨å·²ä¸çº¿204 // await scheduler.regTask('gameYearBox', async (request) => {205 // await require('./gameYearBox').doTask(request, options)206 // }, {207 // ...taskOption,208 // startTime: 18 * 3600209 // })210 // // é¦é¡µ-çæ°-ç§ææ¢å
211 // await scheduler.regTask('NiujieSpikePrize', async (request) => {212 // await require('./Niujie').spikePrize(request, options)213 // }, {214 // ...taskOption,215 // startTime: 9.6 * 3600,216 // ignoreRelay: true217 // })218 // é¦é¡µ-çæ°-转çæ½å¥219 // await scheduler.regTask('NiujieTask', async (request) => {220 // await require('./Niujie').doTask(request, options)221 // }, taskOption)222 // // é¦é¡µ-çæ°-积åé¦-ç¿»ç¾æ½å¥223 // await scheduler.regTask('newYearLottery', async (request) => {224 // await require('./Niujie').newYearLottery(request, options)225 // }, taskOption)226 // // é¦é¡µ-çæ°-åºé¦é¢çæ°227 // await scheduler.regTask('NiujieReceiveCalf', async (request) => {228 // await require('./Niujie').receiveCalf(request, options)229 // }, {230 // isCircle: true,231 // intervalTime: 50 * 60,232 // startTime: 0,233 // ...taskOption234 // })235 // // é¦é¡µ-çæ°-å
æ¢å¥å236 // await scheduler.regTask('convertPrize', async (request) => {237 // await require('./Niujie').convertPrize(request, options)238 // }, {239 // ...taskOption,240 // startTime: 22 * 3600241 // })242 // é¦é¡µ-ç¥è¯-é
读çé¢èµ¢å¥½ç¤¼243 await scheduler.regTask('dailyBookAnswer', async (request) => {244 await require('./dailyBookAnswer').doTask(request, options)245 }, taskOption)246 // é¦é¡µ-积åä¹å-éçå¡247 await scheduler.regTask('newYearUserSign', async (request) => {248 await require('./newYearUserSign').doTask(request, options)249 }, taskOption)250 // é¦é¡µ-ç¾å°æ礼-å
è´¹æ¿-çæ³æ¿å¥251 await scheduler.regTask('dailyFingerSign', async (request) => {252 await require('./dailyFingerSign').doTask(request, options)253 }, taskOption)254 // é¦é¡µ-积ååå-ç«çæ¢è´-ä¸åªæ¾é¼ -çè§é¢å¾ç§¯å255 await scheduler.regTask('dailyShopVideoIntegral', async (request) => {256 await require('./dailyShop').dovideoIntegralTask(request, options)257 }, taskOption)258 // æå¡-åç-å¥é¤åæ´-èµç§¯å259 await scheduler.regTask('dailyPackageIntegral', async (request) => {260 await require('./dailyOtherRewardVideo').doPackeageChangeVideoIntegralTask(request, options)261 }, taskOption)262 // æå¡-æ¥è¯¢-çµåå票-èµç§¯å263 await scheduler.regTask('dailyWisdomActivityIntegral', async (request) => {264 await require('./dailyOtherRewardVideo').doWisdomActivityIntegralTask(request, options)265 }, taskOption)266 // ç¦å©ç¤¾-è人æ°-çè§é¢å¾ç§¯å267 // await scheduler.regTask('doWelfareActivityIntegralTask', async (request) => {268 // await require('./dailyOtherRewardVideo').doWelfareActivityIntegralTask(request, options)269 // }, taskOption)270 // é¦é¡µ-ç¾å°æ礼-å
è´¹é¢-饿äºä¹çº¢å
271 await scheduler.regTask('dailyUnicomTask', async (request) => {272 await require('./dailyUnicomTask').doIntegralAd(request, options)273 await require('./dailyUnicomTask').doTurnCard(request, options)274 }, taskOption)275 // å¬å¥¥ä¸åº-èµ¢å¬å¥¥çºªå¿µå-ç©æ¸¸ææ½å¥276 await scheduler.regTask('olympicgame', async (request) => {277 await require('./olympicgame').doTask(request, options)278 }, taskOption)279 // æçé±å
-æ²é±å
-幸è¿æ½å¤§å¥280 await scheduler.regTask('dailystw', async (request) => {281 await require('./dailystw').doTask(request, options)282 }, taskOption)283 // æ²é±å
-èéæ¯ä»æ¥-转çæ½å¥284 await scheduler.regTask('PayDayParty', async (request) => {285 await require('./PayDayParty').doTask(request, options)286 }, taskOption)287 // å¬å¥¥-å°éªä¿±ä¹é¨-èé客æ·æ¥-幸è¿ä¹å®«æ ¼288 await scheduler.regTask('dailyClubLottery', async (request) => {289 await require('./dailyClubLottery').doTask(request, options)290 }, taskOption)291 // 积ååå-ç¯è¸©å°æ©ï¼æ²èèéå°æ¸¸æï¼292 await scheduler.regTask('woyaoliantong', async (request) => {293 await require('./woyaoliantong').doTask(request, options)294 }, taskOption)295 // è¶
级ææäº-å
宵åä¹ä¼296 // æ´»å¨ä¸çº¿297 // await scheduler.regTask('lanternFestival', async (request) => {298 // await require('./lanternFestival').doTask(request, options)299 // }, taskOption)300 // è¯è´¹è´ç¾å°301 await scheduler.regTask('hfgo', async (request) => {302 await require('./hfgo').doTask(request, options)303 }, taskOption)304 // é¦é¡µ-ç¾å°-APPä¸è½½é¢ç§¯å305 await scheduler.regTask('dailyDownloadApp', async (request) => {306 await require('./dailyDownloadApp').doTask(request, options)307 }, {308 ...taskOption,309 startTime: 13 * 3600,310 })311 // æ¸
çé¢åæäºæªç¥æ¹å¼ç积å312 // 该å¤çå¯è½ä¼å¯¼è´æäºæ´»å¨ä»»å¡æºä¼ä¸è¶³å¯¼è´é误ï¼æ以æ§è¡æ¶é´è¦è¿313 await scheduler.regTask('dailyOtherRewardVideo', async (request) => {314 await require('./dailyOtherRewardVideo').cleanRewardVideo(request, options)315 }, {316 ...taskOption,317 startTime: 21.5 * 3600,318 ignoreRelay: true319 })320 // æ¯æ¥0ç¹èªå¨å
æ¢æµé321// await scheduler.regTask('exchangeDFlow', async (request) => {322// await require('./exchangeDFlow').doTask(request, options)323// }, {324// ...taskOption,325// startTime: 0,326// startHours: 0,327// ignoreRelay: true328// })329 // å®æ¶æ£æµæµéå
æ¢330 // å¯ä½¿ç¨ --exchangeDFlowCircle-intervalTime 1800 é项æå®æµéæ£æ¥é´éæ¶é´ï¼åä½ç§331 // å¯ä½¿ç¨ --exchangeDFlowCircle-minFlow 200 é项æå®æµéæ£æ¥æå°å¼332 // å¯ä½¿ç¨ --exchangeDFlowCircle-productId 21010621565413402 é项æå®å
æ¢æµéå
ID333// let { 'exchangeDFlowCircle-intervalTime': intervalTime = 1800 } = options334// if (typeof intervalTime !== 'number') {335// intervalTime = 1800336// }...
Using AI Code Generation
1import React from 'react';2import { storiesOf } from '@storybook/react';3import { action } from '@storybook/addon-actions';4import { linkTo } from '@storybook/addon-links';5import { withKnobs, text, boolean, number } from '@storybook/addon-knobs';6import { withNotes } from '@storybook/addon-notes';7import { withInfo } from '@storybook/addon-info';8import { withOptions } from '@storybook/addon-options';9import { withViewport } from '@storybook/addon-viewport';10import { withBackgrounds } from '@storybook/addon-backgrounds';11import { withInline } from '@storybook/addon-inline';12import { withTests } from '@storybook/addon-jest';13import { withA11y } from '@storybook/addon-a11y';14import { withConsole } from '@storybook/addon-console';15import { withCSSResources } from '@storybook/addon-cssresources';16import { Button, Welcome } from '@storybook/react/demo';17import { doTask } from 'storybook-root';18storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />);19storiesOf('Button', module)20 .addDecorator(withKnobs)21 .addDecorator(withNotes)22 .addDecorator(withInfo)23 .addDecorator(withOptions)24 .addDecorator(withViewport)25 .addDecorator(withBackgrounds)26 .addDecorator(withInline)27 .addDecorator(withTests)28 .addDecorator(withA11y)29 .addDecorator((storyFn, context) => withConsole()(storyFn)(context))30 .addDecorator(withCSSResources)31 .add('with text', () => <Button onClick={action('clicked')}>{text('Label', 'Hello Button')}</Button>)32 .add('with some emoji', () => (33 <Button onClick={action('clicked')}>34 {boolean('Disabled', false) ? '😀 😎 👍 💯' : '😞 😠 😡 😤'}35 .add('with some number', () => (36 <Button onClick={action('clicked')}>37 {boolean('Disabled', false) ? '😀 😎 👍 💯' : '😞 😠 😡 😤'}38 .add('with some number', () => (39 <Button onClick={action('clicked
Using AI Code Generation
1import { doTask } from 'storybook-root';2import { doTask } from 'storybook-root';3import { doTask } from 'storybook-root';4import { doTask } from 'storybook-root';5import { doTask } from 'storybook-root';6import { doTask } from 'storybook-root';7import { doTask } from 'storybook-root';8import { doTask } from 'storybook-root';9import { doTask } from 'storybook-root';10import { doTask } from 'storybook-root';11import { doTask } from 'storybook-root';12import { doTask } from 'storybook-root';13import { doTask } from 'storybook-root';14import { doTask } from 'storybook-root';15import { doTask } from 'storybook-root';
Using AI Code Generation
1import { doTask } from 'storybook-root';2doTask();3import { doTask } from './src/task';4export { doTask };5import { doTask } from './task';6export { doTask };7export function doTask() {8 console.log('task done');9}10resolve: {11 alias: {12 'storybook-root': path.resolve(__dirname, '../'),13 },14 },15moduleNameMapper: {16 '^storybook-root(.*)$': '<rootDir>/../$1',17 },18moduleNameMapper: {19 '^storybook-root(.*)$': '<rootDir>/../',20 },21moduleNameMapper: {22 '^storybook-root(.*)$': '<rootDir>/../src',23 },24moduleNameMapper: {25 '^storybook-root(.*)$': '<rootDir>/../src/task',26 },27moduleNameMapper: {28 '^storybook-root(.*)$': '<rootDir>/../src/task.js',29 },30moduleNameMapper: {31 '^storybook-root(.*)$': '<rootDir>/../storybook-root',32 },33moduleNameMapper: {34 '^storybook-root(.*)$': '<rootDir>/../storybook-root/src',35 },36moduleNameMapper: {37 '^storybook-root(.*)$': '<rootDir>/../storybook-root/src
Using AI Code Generation
1import { doTask } from 'storybook-root'2doTask()3export { doTask } from './lib'4export const doTask = () => {5 console.log('doTask')6}
Using AI Code Generation
1import {doTask} from 'storybook-root';2doTask();3import {doTask} from '../test';4export {doTask};5import {doTask} from '../test';6export {doTask};7import {doTask} from '../test';8export {doTask};9I've tried to create a storybook for the Button component that uses the useInput hook. I've tried to import the useInput hook in Button.stories.js using the following:10import { useInput } from '../hooks';11I also tried importing the useInput hook in Button.js using the following:12import { useInput } from '../hooks';13I've also tried importing the useInput hook in index.js using the following:14import { useInput } from '../hooks';15I've tried importing the useInput hook in Button.stories.js using
Using AI Code Generation
1import { doTask } from 'storybook-root';2doTask();3export const doTask = () => {4 console.log('doTask');5};6import { doTask } from 'storybook-root';7doTask();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!