lscontests 1.10.0 → 1.10.1

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
@@ -10,6 +10,8 @@
10
10
 
11
11
  A tool to get information about the contests on each OJ.
12
12
 
13
+ [中文文档](./README-zh-CN.md)
14
+
13
15
  ## Installation
14
16
 
15
17
  ### Only use CLI
@@ -18,7 +20,7 @@ For npm: `npm install -g lscontests`
18
20
 
19
21
  For yarn: `yarn global add lscontests`
20
22
 
21
- ### Add to your package
23
+ ### Add *lscontests* to your project
22
24
 
23
25
  For npm: `npm install lscontests --save`
24
26
 
@@ -28,7 +30,7 @@ For yarn: `yarn add lscontests`
28
30
 
29
31
  ### CLI
30
32
 
31
- You can use cli to get a list of information about upcoming contests easily.
33
+ You can use cli to get a list of information about contests easily.
32
34
 
33
35
  <!-- block_help begin -->
34
36
  ```text
@@ -50,64 +52,13 @@ Options:
50
52
  It performs as follows:
51
53
 
52
54
  <!-- block_cli begin -->
53
- (*The following content was automatically generated in Sat, 14 May 2022 02:35:31 GMT*)
55
+ (*The following content was automatically generated by [semantic-release](https://github.com/semantic-release/semantic-release) in Sat, 14 May 2022 13:07:09 GMT*)
54
56
 
55
57
  <details>
56
58
  <summary> <code>> lsct </code> </summary>
57
59
 
58
60
  ```text
59
- 在 AtCoder,Codeforces,LeetCode,Luogu,NowCoder 上有 2 场正在进行的比赛
60
-
61
- 比赛平台: NowCoder
62
- 比赛名称:牛客竞赛博弈专题班 Sprague-Grundy 函数(SG 函数、图游戏、Nim 和)
63
- 赛制: ICPC
64
- 开始时间: 5/13/2022, 04:00:00
65
- 结束时间: 5/21/2022, 13:00:00
66
- https://ac.nowcoder.com/acm/contest/34655
67
-
68
- 比赛平台: NowCoder
69
- 比赛名称: 2022 图论班第一章图匹配例题与习题
70
- 赛制: ICPC
71
- 开始时间: 5/13/2022, 06:00:00
72
- 结束时间: 5/30/2022, 08:00:00
73
- https://ac.nowcoder.com/acm/contest/34649
74
-
75
- 接下来的 3 天内在 AtCoder,Codeforces,LeetCode,Luogu,NowCoder 上有 10 场比赛
76
-
77
- 比赛平台: NowCoder
78
- 比赛名称:第二届天元编程邀请赛(提高组)
79
- 赛制: IOI
80
- 开始时间: 5/14/2022, 04:30:00
81
- 结束时间: 5/14/2022, 09:00:00
82
- https://ac.nowcoder.com/acm/contest/33335
83
-
84
- 比赛平台: NowCoder
85
- 比赛名称:第二届天元编程邀请赛(普及组)
86
- 赛制: IOI
87
- 开始时间: 5/14/2022, 04:30:00
88
- 结束时间: 5/14/2022, 08:00:00
89
- https://ac.nowcoder.com/acm/contest/33341
90
-
91
- 比赛平台: NowCoder
92
- 比赛名称:第十八届西南科技大学 ACM 程序设计竞赛(同步赛)
93
- 赛制: ICPC
94
- 开始时间: 5/14/2022, 05:00:00
95
- 结束时间: 5/14/2022, 10:00:00
96
- https://ac.nowcoder.com/acm/contest/33540
97
-
98
- 比赛平台: Luogu
99
- 比赛名称: 【LGR-109】洛谷 5 月月赛 II & Windy Round 6
100
- 赛制: IOI
101
- 开始时间: 5/14/2022, 06:00:00
102
- 结束时间: 5/14/2022, 10:00:00
103
- https://www.luogu.com.cn/contest/68326
104
-
105
- 比赛平台: Codeforces
106
- 比赛名称: Codeforces Round #791 (Div. 2)
107
- 赛制: Codeforces
108
- 开始时间: 5/14/2022, 09:35:00
109
- 结束时间: 5/14/2022, 11:35:00
110
- https://codeforces.com/contests/1679
61
+ 在 AtCoder,Codeforces,LeetCode,Luogu,NowCoder 上有 1 场正在进行的比赛
111
62
 
112
63
  比赛平台: AtCoder
113
64
  比赛名称: Ⓐ Panasonic Programming Contest 2022 (AtCoder Beginner Contest 251)
@@ -116,6 +67,8 @@ https://codeforces.com/contests/1679
116
67
  结束时间: 5/14/2022, 13:40:00
117
68
  https://atcoder.jp/contests/abc251
118
69
 
70
+ 接下来的 3 天内在 AtCoder,Codeforces,LeetCode,Luogu,NowCoder 上有 4 场比赛
71
+
119
72
  比赛平台: LeetCode
120
73
  比赛名称: Biweekly Contest 78
121
74
  赛制: AtCoder
@@ -148,93 +101,26 @@ https://atcoder.jp/contests/arc140
148
101
  </details>
149
102
 
150
103
  <details>
151
- <summary> <code>> lsct -o at cf -d 7</code> </summary>
104
+ <summary> <code>> lsct -o at cf -d 7 -L en</code> </summary>
152
105
 
153
106
  ```text
154
- AtCoder,Codeforces 上没有正在进行的比赛捏
155
-
156
- 接下来的 7 天内在 AtCoder,Codeforces 上有 3 场比赛
107
+ There are 1 contests is running on AtCoder,Codeforces
157
108
 
158
- 比赛平台: Codeforces
159
- 比赛名称: Codeforces Round #791 (Div. 2)
160
- 赛制: Codeforces
161
- 开始时间: 5/14/2022, 09:35:00
162
- 结束时间: 5/14/2022, 11:35:00
163
- https://codeforces.com/contests/1679
164
-
165
- 比赛平台: AtCoder
166
- 比赛名称: Ⓐ Panasonic Programming Contest 2022 (AtCoder Beginner Contest 251)
167
- 赛制: AtCoder
168
- 开始时间: 5/14/2022, 12:00:00
169
- 结束时间: 5/14/2022, 13:40:00
109
+ OJ: AtCoder
110
+ Contest name: Panasonic Programming Contest 2022(AtCoder Beginner Contest 251)
111
+ Rule: AtCoder
112
+ Start time: 5/14/2022, 12:00:00
113
+ End time: 5/14/2022, 13:40:00
170
114
  https://atcoder.jp/contests/abc251
171
115
 
172
- 比赛平台: AtCoder
173
- 比赛名称: Ⓐ AtCoder Regular Contest 140
174
- 赛制: AtCoder
175
- 开始时间: 5/15/2022, 12:00:00
176
- 结束时间: 5/15/2022, 14:00:00
177
- https://atcoder.jp/contests/arc140
178
- ```
179
-
180
- </details>
181
-
182
- <details>
183
- <summary> <code>> lsct -o lg nc -d 7 -L en</code> </summary>
116
+ There are 1 contests on AtCoder,Codeforces in the next 7 days
184
117
 
185
- ```text
186
- There are 2 contests is running on Luogu,NowCoder
187
-
188
- OJ: NowCoder
189
- Contest name: 牛客竞赛博弈专题班 Sprague-Grundy 函数(SG 函数、图游戏、Nim 和)
190
- Rule: ICPC
191
- Start time: 5/13/2022, 04:00:00
192
- End time: 5/21/2022, 13:00:00
193
- https://ac.nowcoder.com/acm/contest/34655
194
-
195
- OJ: NowCoder
196
- Contest name: 2022 图论班第一章图匹配例题与习题
197
- Rule: ICPC
198
- Start time: 5/13/2022, 06:00:00
199
- End time: 5/30/2022, 08:00:00
200
- https://ac.nowcoder.com/acm/contest/34649
201
-
202
- There are 5 contests on Luogu,NowCoder in the next 7 days
203
-
204
- OJ: NowCoder
205
- Contest name: 第二届天元编程邀请赛(提高组)
206
- Rule: IOI
207
- Start time: 5/14/2022, 04:30:00
208
- End time: 5/14/2022, 09:00:00
209
- https://ac.nowcoder.com/acm/contest/33335
210
-
211
- OJ: NowCoder
212
- Contest name: 第二届天元编程邀请赛(普及组)
213
- Rule: IOI
214
- Start time: 5/14/2022, 04:30:00
215
- End time: 5/14/2022, 08:00:00
216
- https://ac.nowcoder.com/acm/contest/33341
217
-
218
- OJ: NowCoder
219
- Contest name: 第十八届西南科技大学 ACM 程序设计竞赛(同步赛)
220
- Rule: ICPC
221
- Start time: 5/14/2022, 05:00:00
222
- End time: 5/14/2022, 10:00:00
223
- https://ac.nowcoder.com/acm/contest/33540
224
-
225
- OJ: Luogu
226
- Contest name: 【LGR-109】洛谷 5 月月赛 II & Windy Round 6
227
- Rule: IOI
228
- Start time: 5/14/2022, 06:00:00
229
- End time: 5/14/2022, 10:00:00
230
- https://www.luogu.com.cn/contest/68326
231
-
232
- OJ: Luogu
233
- Contest name: 「WHOI」Round 1
234
- Rule: IOI
235
- Start time: 5/15/2022, 06:00:00
236
- End time: 5/15/2022, 10:00:00
237
- https://www.luogu.com.cn/contest/67377
118
+ OJ: AtCoder
119
+ Contest name: AtCoder Regular Contest 140
120
+ Rule: AtCoder
121
+ Start time: 5/15/2022, 12:00:00
122
+ End time: 5/15/2022, 14:00:00
123
+ https://atcoder.jp/contests/arc140
238
124
  ```
239
125
 
240
126
  </details>
@@ -244,8 +130,7 @@ https://www.luogu.com.cn/contest/67377
244
130
 
245
131
  ```json
246
132
  {
247
- "running": [],
248
- "upcoming": [
133
+ "running": [
249
134
  {
250
135
  "ojName": "AtCoder",
251
136
  "name": "Ⓐ Panasonic Programming Contest 2022(AtCoder Beginner Contest 251)",
@@ -253,7 +138,9 @@ https://www.luogu.com.cn/contest/67377
253
138
  "startTime": "2022-05-14T12:00:00.000Z",
254
139
  "endTime": "2022-05-14T13:40:00.000Z",
255
140
  "url": "https://atcoder.jp/contests/abc251"
256
- },
141
+ }
142
+ ],
143
+ "upcoming": [
257
144
  {
258
145
  "ojName": "AtCoder",
259
146
  "name": "Ⓐ AtCoder Regular Contest 140",
@@ -261,14 +148,6 @@ https://www.luogu.com.cn/contest/67377
261
148
  "startTime": "2022-05-15T12:00:00.000Z",
262
149
  "endTime": "2022-05-15T14:00:00.000Z",
263
150
  "url": "https://atcoder.jp/contests/arc140"
264
- },
265
- {
266
- "ojName": "Codeforces",
267
- "name": "Codeforces Round #791 (Div. 2)",
268
- "rule": "Codeforces",
269
- "startTime": "2022-05-14T09:35:00.000Z",
270
- "endTime": "2022-05-14T11:35:00.000Z",
271
- "url": "https://codeforces.com/contests/1679"
272
151
  }
273
152
  ]
274
153
  }
@@ -279,9 +158,11 @@ https://www.luogu.com.cn/contest/67377
279
158
 
280
159
  ### API
281
160
 
161
+ For more detailed API documentation, please visit <https://lsct.agoh.xyz>.
162
+
282
163
  If you want to get a list of contest information in your project by calling *lscontests*, or if you need to add support for other OJs, then you can call the *lscontests* API as follows:
283
164
 
284
- #### Get contests information string
165
+ #### Get text for contests information
285
166
 
286
167
  ```typescript
287
168
  import { getContestInfo } from "lscontests";
@@ -291,7 +172,7 @@ getContestsInfoText({ abbrList: ["cf", "lg"] }).then(console.log);
291
172
 
292
173
  This code gives the same result as `lsct -o cf lg`.
293
174
 
294
- #### Get contests information list
175
+ #### Get list for contests information
295
176
 
296
177
  ```typescript
297
178
  import { getContestList } from "lscontests";
@@ -301,7 +182,7 @@ getContests({ sort: false }).then(console.log);
301
182
 
302
183
  This code gives the same result as `lsct -r --no-sort`.
303
184
 
304
- #### Add OJ support
185
+ #### Add support for other OJ
305
186
 
306
187
  ```typescript
307
188
  import { addOJ, getContestsInfoText, getContests } from "lscontests";
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare type config = {
6
6
  };
7
7
  /**
8
8
  * Get the list of all contests matching the given config
9
- * @param config The config of contests that want to get. @see config
9
+ * @param config The config of contests that want to get
10
10
  * @returns A Promise that contains an array of all contests that match the given config
11
11
  */
12
12
  export declare function getContests(config?: config): Promise<{
@@ -15,7 +15,7 @@ export declare function getContests(config?: config): Promise<{
15
15
  }>;
16
16
  /**
17
17
  * Get the detailed text of all contests matching the given config
18
- * @param config The config of contests that want to get @see config
18
+ * @param config The config of contests that want to get
19
19
  * @param language Language of the output text
20
20
  * @returns A string containing detail text of contests that match the given config
21
21
  */
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ function resolveConfig(config) {
30
30
  }
31
31
  /**
32
32
  * Get the list of all contests matching the given config
33
- * @param config The config of contests that want to get. @see config
33
+ * @param config The config of contests that want to get
34
34
  * @returns A Promise that contains an array of all contests that match the given config
35
35
  */
36
36
  function getContests(config) {
@@ -62,7 +62,7 @@ function getContests(config) {
62
62
  exports.getContests = getContests;
63
63
  /**
64
64
  * Get the detailed text of all contests matching the given config
65
- * @param config The config of contests that want to get @see config
65
+ * @param config The config of contests that want to get
66
66
  * @param language Language of the output text
67
67
  * @returns A string containing detail text of contests that match the given config
68
68
  */
@@ -44,7 +44,7 @@ exports.at = {
44
44
  const response = yield axios_1.default.get("https://atcoder.jp/contests");
45
45
  const $ = cheerio.load(response.data);
46
46
  const contests = [];
47
- $("#contest-table-upcoming table > tbody > tr").each(function () {
47
+ $("#contest-table-upcoming,#contest-table-action table > tbody > tr").each(function () {
48
48
  const ct = {
49
49
  ojName: exports.at.name,
50
50
  name: "",
@@ -1 +1 @@
1
- {"version":3,"file":"atcoder.js","sourceRoot":"","sources":["../../../src/lib/oj/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,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG;gBAE5B,IAAG,GAAG,IAAI,CAAC;oBAAE,EAAE,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;qBAChD,IAAG,GAAG,IAAI,CAAC,EAChB;oBACI,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,IAAG,GAAG,IAAI,CAAC,EAChB;oBACI,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,EAAE,GAAG,IAAI,CAAC,CAAC;iBAChG;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lscontests",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "A tool to get information about the contests on each OJ",
5
5
  "keywords": [
6
6
  "cli",
@@ -26,7 +26,7 @@
26
26
  "scripts": {
27
27
  "build": "rimraf ./dist/* && tsc -p src",
28
28
  "clean": "rimraf ./dist",
29
- "docs": "typedoc --out docs ./src/index.ts",
29
+ "docs": "typedoc --footerTypedocVersion --footerDate --footerTime",
30
30
  "lint": "eslint && markdownlint README.md",
31
31
  "prestart": "yarn build",
32
32
  "start": "node ./dist/cli.js"
@@ -49,6 +49,7 @@
49
49
  "markdownlint-cli": "^0.31.1",
50
50
  "rimraf": "^3.0.2",
51
51
  "typedoc": "^0.22.15",
52
+ "typedoc-plugin-extras": "^2.2.3",
52
53
  "typescript": "^4.6.4"
53
54
  },
54
55
  "config": {