lscontests 1.5.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,59 +16,122 @@ A tool to get information about the contests on each OJ.
16
16
 
17
17
  You can use cli to get a list of contests information easily.
18
18
 
19
- ```bash
19
+ ```text
20
20
  lsct [options]
21
21
 
22
22
  Options:
23
- -V, --version output the version number
24
- -d, --days, <day> Number of days to get contests information (default: "3")
25
- -l, --list List all supported OJ
26
- -o, --oj <ojs...> OJs to get contests information (choices: "cf", "lg", "nc")
27
- -h, --help display help for command
23
+ -V, --version output the version number
24
+ -d, --days, <day> Number of days to get contests information (default: "3")
25
+ -l, --list List all supported OJ
26
+ -o, --oj <ojs...> OJs to get contests information (choices: "at", "cf", "lg", "nc")
27
+ -r, --raw Print raw contest list
28
+ -L, --language <lang> Set output language (choices: "en", "zh-CN", "zh-TW", default: "zh-CN")
29
+ --no-sort Do not sort by contests start time, but by OJ order
30
+ -h, --help display help for command
31
+ ```
32
+
33
+ It performs as follows:
34
+
35
+ <details>
36
+ <summary> > lsct -o cf lg </summary>
37
+
38
+ ```text
39
+ 在最近的 3 天内有 2 场比赛
40
+
41
+
42
+ 比赛平台: Codeforces
43
+ 赛制: ICPC
44
+ 开始时间: 2022/5/13 22:35:00
45
+ 结束时间: 2022/5/14 00:35:00
46
+ https://codeforces.com/contests/1680
47
+
48
+
49
+ 比赛平台: Luogu
50
+ 赛制: IOI
51
+ 开始时间: 2022/5/14 14:00:00
52
+ 结束时间: 2022/5/14 18:00:00
53
+ https://www.luogu.com.cn/contest/68326
54
+ ```
55
+
56
+ </details>
57
+
58
+ <details>
59
+ <summary> > lsct -o cf lg -L en </summary>
60
+
61
+ ```text
62
+ 2 contests in the last 3 days
63
+
64
+
65
+ OJ: Codeforces
66
+ Rule: ICPC
67
+ Start time: 2022/5/13 22:35:00
68
+ End time: 2022/5/14 00:35:00
69
+ https://codeforces.com/contests/1680
70
+
71
+
72
+ OJ: Luogu
73
+ Rule: IOI
74
+ Start time: 2022/5/14 14:00:00
75
+ End time: 2022/5/14 18:00:00
76
+ https://www.luogu.com.cn/contest/68326
28
77
  ```
29
78
 
30
- Its performance:
79
+ </details>
80
+
81
+ <details>
82
+ <summary> > lsct -r -o cf lg </summary>
31
83
 
32
84
  ```bash
33
- > lsct
34
85
  [
35
86
  {
36
87
  ojName: 'Codeforces',
37
- name: 'Codeforces Round #790 (Div. 4)',
88
+ name: 'Educational Codeforces Round 128 (Rated for Div. 2)',
38
89
  rule: 'ICPC',
39
- startTime: 2022-05-10T14:35:00.000Z,
40
- endTime: 2022-05-10T16:35:00.000Z,
41
- url: 'https://codeforces.com/contests/1676'
90
+ startTime: 2022-05-13T14:35:00.000Z,
91
+ endTime: 2022-05-13T16:35:00.000Z,
92
+ url: 'https://codeforces.com/contests/1680'
42
93
  },
43
94
  {
44
- ojName: 'NowCoder',
45
- name: '牛客挑战赛60',
46
- rule: 'ICPC',
47
- startTime: 2022-05-13T11:00:00.000Z,
48
- endTime: 2022-05-13T14:00:00.000Z,
49
- url: 'https://ac.nowcoder.com/acm/contest/11200'
95
+ ojName: 'Luogu',
96
+ name: '【LGR-109】洛谷 5 月月赛 II & Windy Round 6',
97
+ rule: 'IOI',
98
+ startTime: 2022-05-14T06:00:00.000Z,
99
+ endTime: 2022-05-14T10:00:00.000Z,
100
+ url: 'https://www.luogu.com.cn/contest/68326'
50
101
  }
51
102
  ]
52
103
  ```
53
104
 
105
+ </details>
106
+
54
107
  ### API
55
108
 
56
109
  If you want to call lscontests in your project to get a list of contests information, or if you need to add OJ support, then you can call the lscontests API like the following:
57
110
 
58
- #### Get a list of contests information
111
+ #### Get contests information string
112
+
113
+ ```typescript
114
+ import { getString } from "lscontests";
115
+
116
+ getString({ abbrList: ["cf", "lg"] }).then(console.log);
117
+ ```
118
+
119
+ The result of this code is the same as `lsct -o cf lg`.
120
+
121
+ #### Get contests information list
59
122
 
60
123
  ```typescript
61
- import { list } from "lscontests";
124
+ import { getList } from "lscontests";
62
125
 
63
- list().then(console.log);
126
+ getList({ sort: false }).then(console.log);
64
127
  ```
65
128
 
66
- The result of this code is the same as using cli directly without arguments.
129
+ The result of this code is the same as `lsct -r --no-sort`.
67
130
 
68
131
  #### Add OJ support
69
132
 
70
133
  ```typescript
71
- import { addOJ, list } from "lscontests";
134
+ import { addOJ, getList } from "lscontests";
72
135
 
73
136
  addOJ("ts", {
74
137
  name: "testOJ", get: async () => [{
@@ -81,7 +144,7 @@ addOJ("ts", {
81
144
  }]
82
145
  });
83
146
 
84
- list(["ts"], 7).then(console.log);
147
+ getList({ abbrList: ["ts"], days: 7 }).then(console.log);
85
148
  ```
86
149
 
87
150
  The result of this code is as follows:
package/dist/cli.js CHANGED
@@ -20,14 +20,26 @@ commander_1.program
20
20
  .option("-d, --days, <day>", "Number of days to get contests information", "3")
21
21
  .option("-l, --list", "List all supported OJ")
22
22
  .addOption(new commander_1.Option("-o, --oj <ojs...>", "OJs to get contests information").choices(Object.keys(oj_1.alloj)))
23
+ .addOption(new commander_1.Option("-r, --raw", "Print raw contest list").conflicts("language"))
24
+ .addOption(new commander_1.Option("-L, --language <lang>", "Set output language").default("zh-CN").choices(_1.langList))
25
+ .option("--no-sort", "Do not sort by contests start time, but by OJ order")
23
26
  .parse();
24
27
  const opts = commander_1.program.opts();
25
28
  function main() {
26
29
  return __awaiter(this, void 0, void 0, function* () {
27
30
  if (opts.list)
28
31
  console.log(Object.values(oj_1.alloj).map((oj) => oj.name));
29
- else
30
- console.log(yield (0, _1.list)(opts.oj, opts.days));
32
+ else {
33
+ const config = {
34
+ abbrList: opts.oj,
35
+ days: opts.days,
36
+ sort: opts.sort
37
+ };
38
+ if (opts.raw)
39
+ console.log(yield (0, _1.getList)(config));
40
+ else
41
+ console.log(yield (0, _1.getString)(config, opts.language));
42
+ }
31
43
  });
32
44
  }
33
45
  main();
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","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,iCAAiC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,UAAK,CAAC,CAAC,CAAC;KACzG,SAAS,CAAC,IAAI,kBAAM,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;KAClF,SAAS,CAAC,IAAI,kBAAM,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,WAAQ,CAAC,CAAC;KACxG,MAAM,CAAC,WAAW,EAAE,qDAAqD,CAAC;KAC1E,KAAK,EAAE,CAAC;AAEb,MAAM,IAAI,GAAG,mBAAO,CAAC,IAAI,EAAE,CAAC;AAE5B,SAAe,IAAI;;QACf,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,UAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;aACjE;YACD,MAAM,MAAM,GAAW;gBACnB,QAAQ,EAAE,IAAI,CAAC,EAAE;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAc;gBACzB,IAAI,EAAE,IAAI,CAAC,IAAI;aAClB,CAAC;YACF,IAAI,IAAI,CAAC,GAAG;gBAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAA,UAAO,EAAC,MAAM,CAAC,CAAC,CAAC;;gBAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,IAAA,YAAS,EAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC5D;IACL,CAAC;CAAA;AAED,IAAI,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,10 @@
1
1
  import { addOJ } from "./lib/oj";
2
- declare function list(abbrList?: string[], days?: number): Promise<import("./lib/contest").contest[]>;
3
- export { addOJ, list };
2
+ export declare type config = {
3
+ abbrList?: string[];
4
+ days?: number;
5
+ sort?: boolean;
6
+ };
7
+ declare function getList(config?: config): Promise<import("./lib/contest").contest[]>;
8
+ export declare const langList: string[];
9
+ declare function getString(config?: config, language?: string): Promise<string>;
10
+ export { addOJ, getList, getString };
package/dist/index.js CHANGED
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,17 +32,62 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.list = exports.addOJ = void 0;
35
+ exports.getString = exports.getList = exports.addOJ = exports.langList = void 0;
36
+ const fs_1 = require("fs");
13
37
  const oj_1 = require("./lib/oj");
14
38
  Object.defineProperty(exports, "addOJ", { enumerable: true, get: function () { return oj_1.addOJ; } });
15
- function list(abbrList, days = 3) {
39
+ const defaultConfig = {
40
+ abbrList: Object.keys(oj_1.alloj),
41
+ days: 3,
42
+ sort: true
43
+ };
44
+ function getList(config) {
16
45
  return __awaiter(this, void 0, void 0, function* () {
17
- if (!abbrList)
18
- abbrList = Object.keys(oj_1.alloj);
19
- return (yield Promise.all(abbrList.map((abbr) => __awaiter(this, void 0, void 0, function* () {
20
- return (yield oj_1.alloj[abbr].get()).filter((ct) => ct.startTime <= new Date(Date.now() + days * 86400000));
46
+ const cfg = Object.assign(Object.assign({}, defaultConfig), config);
47
+ if (!cfg.abbrList)
48
+ cfg.abbrList = Object.keys(oj_1.alloj);
49
+ const contests = (yield Promise.all(cfg.abbrList.map((abbr) => __awaiter(this, void 0, void 0, function* () {
50
+ try {
51
+ const cts = yield oj_1.alloj[abbr].get();
52
+ return cts.filter((c) => c.startTime <= new Date(Date.now() + cfg.days * 86400000));
53
+ }
54
+ catch (e) {
55
+ console.log(`Failed to get match information for ${oj_1.alloj[abbr].name}, details:`);
56
+ console.error(e);
57
+ return [];
58
+ }
21
59
  })))).reduce((ls1, ls2) => ls1.concat(ls2));
60
+ if (cfg.sort)
61
+ contests.sort((a, b) => a.startTime.getTime() - b.startTime.getTime());
62
+ return contests;
63
+ });
64
+ }
65
+ exports.getList = getList;
66
+ exports.langList = (0, fs_1.readdirSync)(`${__dirname}/locale`).map((fileName) => fileName.replace(".json", ""));
67
+ function format(s, ...args) {
68
+ for (let i = 0; i < args.length; i++)
69
+ s = s.replace(`{${i}}`, args[i]);
70
+ return s;
71
+ }
72
+ function getString(config, language = "zh-CN") {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ if (!exports.langList.includes(language))
75
+ throw new Error(`Illegal language ${language}, the allowed languages are ${exports.langList}`);
76
+ const cfg = Object.assign(Object.assign({}, defaultConfig), config);
77
+ const contests = yield getList(cfg);
78
+ const info = [];
79
+ const lang = yield Promise.resolve().then(() => __importStar(require(`./locale/${language}.json`)));
80
+ info.push(format(lang.welcome, cfg.days.toString(), contests.length.toString()));
81
+ for (const ct of contests) {
82
+ info.push("\n");
83
+ info.push(`${lang.ojName}: ${ct.ojName}`);
84
+ info.push(`${lang.rule}: ${ct.rule}`);
85
+ info.push(`${lang.startTime}: ${ct.startTime.toLocaleString()}`);
86
+ info.push(`${lang.endTime}: ${ct.endTime.toLocaleString()}`);
87
+ info.push(ct.url);
88
+ }
89
+ return info.join("\n");
22
90
  });
23
91
  }
24
- exports.list = list;
92
+ exports.getString = getString;
25
93
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAwC;AAa/B,sFAbA,UAAK,OAaA;AAXd,SAAe,IAAI,CAAC,QAAmB,EAAE,IAAI,GAAG,CAAC;;QAC7C,IAAI,CAAC,QAAQ;YAAE,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,UAAK,CAAC,CAAC;QAC7C,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CACrB,QAAQ,CAAC,GAAG,CACR,CAAO,IAAI,EAAE,EAAE;YAAC,OAAA,CAAC,MAAM,UAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAC5C,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAI,IAAe,GAAG,QAAQ,CAAC,CAC7E,CAAA;UAAA,CACJ,CACJ,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;CAAA;AAEe,oBAAI"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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MAAM,EAAE,IAAI,QAAQ,EAAE;YACvB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;YAC1C,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,KAAK,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;YACjE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,KAAK,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;YAC7D,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;SACrB;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CAAA;AAEwB,8BAAS"}
@@ -1,4 +1,4 @@
1
- export declare type rule = "OI" | "IOI" | "ICPC" | "LeDuo" | "Codeforces";
1
+ export declare type rule = "OI" | "IOI" | "ICPC" | "LeDuo" | "Codeforces" | "AtCoder";
2
2
  export declare type contest = {
3
3
  ojName: string;
4
4
  name: string;
@@ -0,0 +1,2 @@
1
+ import { oj } from ".";
2
+ export declare const at: oj;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.at = void 0;
39
+ const axios_1 = __importDefault(require("axios"));
40
+ const cheerio = __importStar(require("cheerio"));
41
+ exports.at = {
42
+ name: "AtCoder",
43
+ get: () => __awaiter(void 0, void 0, void 0, function* () {
44
+ const response = yield axios_1.default.get("https://atcoder.jp/contests");
45
+ const $ = cheerio.load(response.data);
46
+ const contests = [];
47
+ $("#contest-table-upcoming table > tbody > tr").each(function () {
48
+ const ct = {
49
+ ojName: exports.at.name,
50
+ name: "",
51
+ rule: "AtCoder",
52
+ startTime: new Date(0),
53
+ endTime: new Date(0),
54
+ url: ""
55
+ };
56
+ $("td", this).each(function (idx) {
57
+ if (idx == 0)
58
+ ct.startTime = new Date($(this).text());
59
+ else if (idx == 1) {
60
+ const ele = $("a", this);
61
+ ct.name = `${$("span:first", this).text()} ${ele.text()}`;
62
+ ct.url = `https://atcoder.jp${ele.attr().href}`;
63
+ }
64
+ else if (idx == 2) {
65
+ const [h, s] = $(this).text().split(":");
66
+ ct.endTime = new Date(ct.startTime.getTime() + (parseInt(h) * 60 + parseInt(s)) * 1000);
67
+ }
68
+ });
69
+ contests.push(ct);
70
+ });
71
+ return contests;
72
+ })
73
+ };
74
+ //# sourceMappingURL=atcoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atcoder.js","sourceRoot":"","sources":["../../../src/lib/oj/atcoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAAmC;AAItB,QAAA,EAAE,GAAO;IAClB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,GAAS,EAAE;QACZ,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAChE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAc,EAAE,CAAC;QAC/B,CAAC,CAAC,4CAA4C,CAAC,CAAC,IAAI,CAAC;YACjD,MAAM,EAAE,GAAY;gBAChB,MAAM,EAAE,UAAE,CAAC,IAAI;gBACf,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,SAAS;gBACf,SAAS,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC;gBACtB,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC;gBACpB,GAAG,EAAE,EAAE;aACV,CAAC;YACF,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG;gBAC5B,IAAI,GAAG,IAAI,CAAC;oBAAE,EAAE,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;qBACjD,IAAI,GAAG,IAAI,CAAC,EAAE;oBACf,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;oBACzB,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;oBAC1D,EAAE,CAAC,GAAG,GAAG,qBAAqB,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;iBACnD;qBACI,IAAI,GAAG,IAAI,CAAC,EAAE;oBACf,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBACzC,EAAE,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;iBAC3F;YACL,CAAC,CAAC,CAAC;YACH,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACpB,CAAC,CAAA;CACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- import { oj } from "../oj";
1
+ import { oj } from ".";
2
2
  export declare const cf: oj;
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -14,6 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
37
  Object.defineProperty(exports, "__esModule", { value: true });
15
38
  exports.cf = void 0;
16
39
  const axios_1 = __importDefault(require("axios"));
40
+ const cheerio = __importStar(require("cheerio"));
17
41
  const ruleRecord = {
18
42
  CF: "Codeforces",
19
43
  ICPC: "ICPC"
@@ -21,7 +45,12 @@ const ruleRecord = {
21
45
  exports.cf = {
22
46
  name: "Codeforces",
23
47
  get: () => __awaiter(void 0, void 0, void 0, function* () {
24
- const resList = (yield axios_1.default.get("https://codeforces.com/api/contest.list")).data.result;
48
+ const response = yield axios_1.default.get("https://codeforces.com/api/contest.list");
49
+ if (!(response.data instanceof Object)) {
50
+ const $ = cheerio.load(response.data);
51
+ throw new Error($.text());
52
+ }
53
+ const resList = response.data.result;
25
54
  return resList.map((res) => {
26
55
  return {
27
56
  ojName: exports.cf.name,
@@ -1 +1 @@
1
- {"version":3,"file":"codeforces.js","sourceRoot":"","sources":["../../../src/lib/oj/codeforces.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAe1B,MAAM,UAAU,GAAyB;IACrC,EAAE,E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C5E,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,YAAY,MAAM,CAAC,EAAE;YACpC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;SAC7B;QACD,MAAM,OAAO,GAAa,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;QAC/C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAW,EAAE;YAChC,OAAO;gBACH,MAAM,EAAE,UAAE,CAAC,IAAI;gBACf,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;gBAC1B,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC;gBAChD,OAAO,EAAE,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAgB,GAAG,GAAG,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;gBACtE,GAAG,EAAE,mCAAmC,GAAG,CAAC,EAAE,EAAE;aACnD,CAAC;QACN,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAA;CACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { contest } from "./contest";
1
+ import { contest } from "../contest";
2
2
  export declare type oj = {
3
3
  name: string;
4
4
  get: () => Promise<contest[]>;
@@ -1,16 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addOJ = exports.alloj = void 0;
4
- const codeforces_1 = require("./oj/codeforces");
5
- const luogu_1 = require("./oj/luogu");
6
- const nowcoder_1 = require("./oj/nowcoder");
4
+ const atcoder_1 = require("./atcoder");
5
+ const codeforces_1 = require("./codeforces");
6
+ const luogu_1 = require("./luogu");
7
+ const nowcoder_1 = require("./nowcoder");
7
8
  exports.alloj = {
9
+ at: atcoder_1.at,
8
10
  cf: codeforces_1.cf,
9
11
  lg: luogu_1.lg,
10
- nc: nowcoder_1.nc
12
+ nc: nowcoder_1.nc,
11
13
  };
12
14
  function addOJ(abbr, oj) {
13
15
  exports.alloj[abbr] = oj;
14
16
  }
15
17
  exports.addOJ = addOJ;
16
- //# sourceMappingURL=oj.js.map
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/oj/index.ts"],"names":[],"mappings":";;;AACA,uCAA+B;AAC/B,6CAAkC;AAClC,mCAA6B;AAC7B,yCAAgC;AAOnB,QAAA,KAAK,GAA2B;IACzC,EAAE,EAAF,YAAE;IACF,EAAE,EAAF,eAAE;IACF,EAAE,EAAF,UAAE;IACF,EAAE,EAAF,aAAE;CACL,CAAC;AAEF,SAAgB,KAAK,CAAC,IAAY,EAAE,EAAM;IACtC,aAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAFD,sBAEC"}
@@ -1,2 +1,2 @@
1
- import { oj } from "../oj";
1
+ import { oj } from ".";
2
2
  export declare const lg: oj;
@@ -1,5 +1,2 @@
1
- import { contest } from "../contest";
2
- export declare const nc: {
3
- name: string;
4
- get: () => Promise<contest[]>;
5
- };
1
+ import { oj } from ".";
2
+ export declare const nc: oj;
@@ -63,7 +63,10 @@ const ruleRecord = {
63
63
  exports.nc = {
64
64
  name: "NowCoder",
65
65
  get: () => __awaiter(void 0, void 0, void 0, function* () {
66
- const res = [...yield getResultList(topCategoryFilter.NOWCODERSERIES), ...yield getResultList(topCategoryFilter.SCHOOLCONTEST)];
66
+ const res = [
67
+ ...yield getResultList(topCategoryFilter.NOWCODERSERIES),
68
+ ...yield getResultList(topCategoryFilter.SCHOOLCONTEST)
69
+ ];
67
70
  return res.filter((res) => res.signUpEndCountDownTime > 0).map((res) => {
68
71
  return {
69
72
  ojName: exports.nc.name,
@@ -1 +1 @@
1
- {"version":3,"file":"nowcoder.js","sourceRoot":"","sources":["../../../src/lib/oj/nowcoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAAmC;AA+CnC,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IAClB,8EAAmB,CAAA;IACnB,4EAAa,CAAA;AACjB,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,MAAM,GAAG,GAAG,+CAA+C,CAAC;AAE5D,SAAe,aAAa,CAAC,GAAsB;;QAC/C,MAAM,IAAI,GAAG,CAAC,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,GAAG,sBAAsB,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,EAAE,GAAa,EAAE,CAAC;QACxB,CAAC,CAAC,qCAAqC,CAAC,CAAC,IAAI,CAAC;YAC1C,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,CAAC;IACd,CAAC;CAAA;AAED,MAAM,UAAU,GAAyB;IACrC,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,IAAI;CACV,CAAC;AAEW,QAAA,EAAE,GAAG;IACd,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,GAAS,EAAE;QACZ,MAAM,GAAG,GAAa,CAAC,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,aAAa,CAAC,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CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,CAAC;IACd,CAAC;CAAA;AAED,MAAM,UAAU,GAAyB;IACrC,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,IAAI;CACV,CAAC;AAEW,QAAA,EAAE,GAAO;IAClB,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,GAAS,EAAE;QACZ,MAAM,GAAG,GAAa;YAClB,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,cAAc,CAAC;YACxD,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,aAAa,CAAC;SAC1D,CAAC;QACF,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,sBAAsB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAW,EAAE;YAC5E,OAAO;gBACH,MAAM,EAAE,UAAE,CAAC,IAAI;gBACf,IAAI,EAAE,GAAG,CAAC,WAAW;gBACrB,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;gBAC1B,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC;gBACzC,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC;gBACrC,GAAG,EAAE,uCAAuC,GAAG,CAAC,SAAS,EAAE;aAC9D,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,CAAA;CACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ {
2
+ "welcome": "{1} contests in the last {0} days",
3
+ "ojName": "OJ",
4
+ "name": "Contest name",
5
+ "rule": "Rule",
6
+ "startTime": "Start time",
7
+ "endTime": "End time"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "welcome": "在最近的 {0} 天内有 {1} 场比赛",
3
+ "ojName": "比赛平台",
4
+ "name": "比赛名称",
5
+ "rule": "赛制",
6
+ "startTime": "开始时间",
7
+ "endTime": "结束时间"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "welcome": "在最近的 {0} 天內有 {1} 場比賽",
3
+ "ojName": "比賽平台",
4
+ "name": "比賽名稱",
5
+ "rule": "賽制",
6
+ "startTime": "開始時間",
7
+ "endTime": "結束時間"
8
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es6",
4
+ "module": "commonjs",
5
+ "esModuleInterop": true,
6
+ "forceConsistentCasingInFileNames": true,
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ "sourceMap": true,
10
+ "declaration": true,
11
+ "outDir": "../dist/",
12
+ "resolveJsonModule": true
13
+ },
14
+ "include": [
15
+ "**/*.ts",
16
+ "**/*.json"
17
+ ],
18
+ "references": [
19
+ {
20
+ "path": "../"
21
+ }
22
+ ]
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lscontests",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "description": "A tool to get information about the contests on each OJ",
5
5
  "keywords": [
6
6
  "cli",
@@ -1 +0,0 @@
1
- {"version":3,"file":"oj.js","sourceRoot":"","sources":["../../src/lib/oj.ts"],"names":[],"mappings":";;;AACA,gDAAqC;AACrC,sCAAgC;AAChC,4CAAmC;AAOtB,QAAA,KAAK,GAA2B;IACzC,EAAE,EAAF,eAAE;IACF,EAAE,EAAF,UAAE;IACF,EAAE,EAAF,aAAE;CACL,CAAC;AAEF,SAAgB,KAAK,CAAC,IAAY,EAAE,EAAM;IACtC,aAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAFD,sBAEC"}