lscontests 1.8.9 → 1.8.10
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 +51 -42
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/locale/en.json +1 -1
- package/dist/locale/zh-CN.json +1 -1
- package/dist/locale/zh-TW.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# lscontests
|
2
2
|
|
3
|
-

|
4
|
-

|
5
|
-
](https://github.com/StableAgOH/lscontests)
|
4
|
+
[](https://github.com/StableAgOH/lscontests)
|
5
|
+
[](https://github.com/StableAgOH/lscontests)
|
6
6
|
[](https://github.com/semantic-release/semantic-release)
|
7
7
|
|
8
|
-

|
9
|
-

|
8
|
+
[](https://www.npmjs.com/package/lscontests)
|
9
|
+
[](https://www.npmjs.com/package/lscontests)
|
10
10
|
|
11
11
|
A tool to get information about the contests on each OJ.
|
12
12
|
|
@@ -17,7 +17,7 @@ A tool to get information about the contests on each OJ.
|
|
17
17
|
You can use cli to get a list of information about upcoming contests easily.
|
18
18
|
|
19
19
|
```text
|
20
|
-
lsct [options]
|
20
|
+
Usage: lsct [options]
|
21
21
|
|
22
22
|
Options:
|
23
23
|
-V, --version output the version number
|
@@ -32,11 +32,36 @@ Options:
|
|
32
32
|
|
33
33
|
It performs as follows:
|
34
34
|
|
35
|
+
<details>
|
36
|
+
<summary> <code>> lsct</code> </summary>
|
37
|
+
|
38
|
+
```text
|
39
|
+
最近的 3 天内在 AtCoder,Codeforces,Luogu,NowCoder 上有 7 场比赛
|
40
|
+
|
41
|
+
比赛平台: NowCoder
|
42
|
+
比赛名称: 牛客挑战赛60
|
43
|
+
赛制: ICPC
|
44
|
+
开始时间: 2022/5/13 19:00:00
|
45
|
+
结束时间: 2022/5/13 22:00:00
|
46
|
+
https://ac.nowcoder.com/acm/contest/11200
|
47
|
+
|
48
|
+
比赛平台: Codeforces
|
49
|
+
比赛名称: Educational Codeforces Round 128 (Rated for Div. 2)
|
50
|
+
赛制: ICPC
|
51
|
+
开始时间: 2022/5/13 22:35:00
|
52
|
+
结束时间: 2022/5/14 00:35:00
|
53
|
+
https://codeforces.com/contests/1680
|
54
|
+
|
55
|
+
......
|
56
|
+
```
|
57
|
+
|
58
|
+
</details>
|
59
|
+
|
35
60
|
<details>
|
36
61
|
<summary> <code>> lsct -o at cf</code> </summary>
|
37
62
|
|
38
63
|
```text
|
39
|
-
|
64
|
+
最近的 3 天内在 AtCoder,Codeforces 上有 3 场比赛
|
40
65
|
|
41
66
|
比赛平台: Codeforces
|
42
67
|
比赛名称: Educational Codeforces Round 128 (Rated for Div. 2)
|
@@ -66,7 +91,7 @@ https://atcoder.jp/contests/abc251
|
|
66
91
|
<summary> <code>> lsct -o lg -d 7 -L en</code> </summary>
|
67
92
|
|
68
93
|
```text
|
69
|
-
2 contests in the last 7 days
|
94
|
+
2 contests on Luogu in the last 7 days
|
70
95
|
|
71
96
|
OJ: Luogu
|
72
97
|
Contest name: 【LGR-109】洛谷 5 月月赛 II & Windy Round 6
|
@@ -86,41 +111,25 @@ https://www.luogu.com.cn/contest/67377
|
|
86
111
|
</details>
|
87
112
|
|
88
113
|
<details>
|
89
|
-
<summary> <code>> lsct -r -o cf
|
114
|
+
<summary> <code>> lsct -r -o cf --no-sort</code> </summary>
|
90
115
|
|
91
116
|
```bash
|
92
117
|
[
|
93
118
|
{
|
94
|
-
ojName:
|
95
|
-
name:
|
96
|
-
rule:
|
97
|
-
startTime: 2022-05-14T09:35:00.000Z,
|
98
|
-
endTime: 2022-05-14T11:35:00.000Z,
|
99
|
-
url:
|
119
|
+
"ojName": "Codeforces",
|
120
|
+
"name": "Codeforces Round #791 (Div. 2)",
|
121
|
+
"rule": "Codeforces",
|
122
|
+
"startTime": "2022-05-14T09:35:00.000Z",
|
123
|
+
"endTime": "2022-05-14T11:35:00.000Z",
|
124
|
+
"url": "https://codeforces.com/contests/1679"
|
100
125
|
},
|
101
126
|
{
|
102
|
-
ojName:
|
103
|
-
name:
|
104
|
-
rule:
|
105
|
-
startTime: 2022-05-13T14:35:00.000Z,
|
106
|
-
endTime: 2022-05-13T16:35:00.000Z,
|
107
|
-
url:
|
108
|
-
},
|
109
|
-
{
|
110
|
-
ojName: 'NowCoder',
|
111
|
-
name: '牛客挑战赛60',
|
112
|
-
rule: 'ICPC',
|
113
|
-
startTime: 2022-05-13T11:00:00.000Z,
|
114
|
-
endTime: 2022-05-13T14:00:00.000Z,
|
115
|
-
url: 'https://ac.nowcoder.com/acm/contest/11200'
|
116
|
-
},
|
117
|
-
{
|
118
|
-
ojName: 'NowCoder',
|
119
|
-
name: '第十八届西南科技大学ACM程序设计竞赛(同步赛)',
|
120
|
-
rule: 'ICPC',
|
121
|
-
startTime: 2022-05-14T05:00:00.000Z,
|
122
|
-
endTime: 2022-05-14T10:00:00.000Z,
|
123
|
-
url: 'https://ac.nowcoder.com/acm/contest/33540'
|
127
|
+
"ojName": "Codeforces",
|
128
|
+
"name": "Educational Codeforces Round 128 (Rated for Div. 2)",
|
129
|
+
"rule": "ICPC",
|
130
|
+
"startTime": "2022-05-13T14:35:00.000Z",
|
131
|
+
"endTime": "2022-05-13T16:35:00.000Z",
|
132
|
+
"url": "https://codeforces.com/contests/1680"
|
124
133
|
}
|
125
134
|
]
|
126
135
|
```
|
@@ -179,13 +188,13 @@ main();
|
|
179
188
|
This code gives the following results:
|
180
189
|
|
181
190
|
```text
|
182
|
-
1 contests in the last 1 days
|
191
|
+
1 contests on Codeforces,testOJ in the last 1 days
|
183
192
|
|
184
193
|
OJ: testOJ
|
185
194
|
Contest name: testContest
|
186
195
|
Rule: ICPC
|
187
|
-
Start time: 2022/5/
|
188
|
-
End time: 2022/5/
|
196
|
+
Start time: 2022/5/13 19:34:10
|
197
|
+
End time: 2022/5/14 19:34:10
|
189
198
|
https://www.test.com
|
190
199
|
|
191
200
|
[
|
@@ -193,8 +202,8 @@ https://www.test.com
|
|
193
202
|
ojName: 'testOJ',
|
194
203
|
name: 'testContest',
|
195
204
|
rule: 'ICPC',
|
196
|
-
startTime: 2022-05-
|
197
|
-
endTime: 2022-05-
|
205
|
+
startTime: 2022-05-13T11:34:13.464Z,
|
206
|
+
endTime: 2022-05-14T11:34:13.464Z,
|
198
207
|
url: 'https://www.test.com'
|
199
208
|
},
|
200
209
|
{
|
package/dist/index.js
CHANGED
@@ -21,11 +21,15 @@ const defaultConfig = {
|
|
21
21
|
days: 3,
|
22
22
|
sort: true
|
23
23
|
};
|
24
|
+
function resolveConfig(config) {
|
25
|
+
const cfg = Object.assign(Object.assign({}, defaultConfig), config);
|
26
|
+
if (cfg.abbrList.length == 0)
|
27
|
+
cfg.abbrList = defaultConfig.abbrList;
|
28
|
+
return cfg;
|
29
|
+
}
|
24
30
|
function getContestList(config) {
|
25
31
|
return __awaiter(this, void 0, void 0, function* () {
|
26
|
-
const cfg =
|
27
|
-
if (cfg.abbrList.length == 0)
|
28
|
-
cfg.abbrList = defaultConfig.abbrList;
|
32
|
+
const cfg = resolveConfig(config);
|
29
33
|
const contests = (yield Promise.all(cfg.abbrList.map((abbr) => __awaiter(this, void 0, void 0, function* () {
|
30
34
|
try {
|
31
35
|
const cts = yield oj_1.alloj[abbr].get();
|
@@ -45,10 +49,15 @@ function getContestList(config) {
|
|
45
49
|
exports.getContestList = getContestList;
|
46
50
|
function getContestInfo(config, language = "zh-CN") {
|
47
51
|
return __awaiter(this, void 0, void 0, function* () {
|
52
|
+
const cfg = resolveConfig(config);
|
48
53
|
const lang = yield (0, locale_1.getLangDict)(language);
|
49
|
-
const contests = yield getContestList(
|
54
|
+
const contests = yield getContestList(cfg);
|
50
55
|
const info = [];
|
51
|
-
info.push(lodash_1.default.template(lang.welcome)({
|
56
|
+
info.push(lodash_1.default.template(lang.welcome)({
|
57
|
+
contestCount: contests.length,
|
58
|
+
days: cfg.days,
|
59
|
+
oj: cfg.abbrList.map(abbr => oj_1.alloj[abbr].name).join(",")
|
60
|
+
}));
|
52
61
|
for (const contest of contests) {
|
53
62
|
const msg = [];
|
54
63
|
msg.push(`${lang.ojName}: ${contest.ojName}`);
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,qCAAuC;AACvC,oDAAuB;AAQvB,MAAM,aAAa,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,UAAK,CAAC;IAC5B,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,IAAI;CACb,CAAC;AAEF,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,qCAAuC;AACvC,oDAAuB;AAQvB,MAAM,aAAa,GAAG;IAClB,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,UAAK,CAAC;IAC5B,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,IAAI;CACb,CAAC;AAEF,SAAS,aAAa,CAAC,MAAe;IAElC,MAAM,GAAG,mCAAQ,aAAa,GAAK,MAAM,CAAE,CAAC;IAC5C,IAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC;QAAE,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;IACnE,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAsB,cAAc,CAAC,MAAe;;QAEhD,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAC/B,GAAG,CAAC,QAAQ,CAAC,GAAG,CACZ,CAAM,IAAI,EAAC,EAAE;YAET,IACA;gBACI,MAAM,GAAG,GAAG,MAAM,UAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;gBACpC,OAAO,GAAG,CAAC,MAAM,CAAC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