lscontests 2.6.2 → 2.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 +168 -92
- package/dist/lib/contest.d.ts +1 -1
- package/dist/lib/oj/nowcoder.js +2 -2
- package/dist/lib/oj/nowcoder.js.map +1 -1
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/locale/index.js.map +1 -1
- package/dist/server-cli.d.ts +2 -0
- package/dist/server-cli.js +25 -0
- package/dist/server-cli.js.map +1 -0
- package/dist/server.d.ts +2 -2
- package/dist/server.js +31 -23
- package/dist/server.js.map +1 -1
- package/package.json +30 -26
- package/{dist/server.html → public/index.html} +6 -14
- package/dist/locale/zh-NE.json +0 -13
package/README.md
CHANGED
|
@@ -44,8 +44,8 @@ Options:
|
|
|
44
44
|
-s, --silent do not print log
|
|
45
45
|
-o, --oj <ojs...> OJs to display (choices: "at", "cf", "lc", "lg", "nc")
|
|
46
46
|
-r, --raw print raw contest list
|
|
47
|
-
-L, --language <lang> set output language (choices: "en", "zh-CN", "zh-
|
|
48
|
-
|
|
47
|
+
-L, --language <lang> set output language (choices: "en", "zh-CN", "zh-TW",
|
|
48
|
+
default: "zh-CN")
|
|
49
49
|
--no-sort do not sort by contests start time, but by OJ order
|
|
50
50
|
--no-running do not list all running contests
|
|
51
51
|
--no-upcoming do not list all upcoming contests
|
|
@@ -56,36 +56,57 @@ Options:
|
|
|
56
56
|
It performs as follows:
|
|
57
57
|
|
|
58
58
|
<!-- block_cli begin -->
|
|
59
|
-
(*The following content was automatically generated using [semantic-release](https://github.com/semantic-release/semantic-release) on Sun,
|
|
59
|
+
(*The following content was automatically generated using [semantic-release](https://github.com/semantic-release/semantic-release) on Sun, 24 Sep 2023 06:43:05 GMT*)
|
|
60
60
|
|
|
61
61
|
<details>
|
|
62
62
|
<summary> <code>> lsct -L en</code> </summary>
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
|
-
There are
|
|
65
|
+
There are 2 contests is running on Luogu,AtCoder
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
OJ: Luogu
|
|
68
|
+
Contest name: [ICPC2021 Macao R] ICPC2021 区域赛澳门站重现赛
|
|
69
|
+
Rule: ICPC
|
|
70
|
+
Start time: 9/24/2023, 05:00:00
|
|
71
|
+
End time: 9/24/2023, 10:00:00
|
|
72
|
+
https://www.luogu.com.cn/contest/134300
|
|
68
73
|
|
|
69
74
|
OJ: AtCoder
|
|
70
|
-
Contest name:
|
|
75
|
+
Contest name: Ⓗ Marubeni Programming Contest 2023 (AtCoder Heuristic Contest 024)
|
|
71
76
|
Rule: AtCoder
|
|
72
|
-
Start time:
|
|
73
|
-
End time:
|
|
74
|
-
https://atcoder.jp/contests/
|
|
77
|
+
Start time: 9/24/2023, 06:00:00
|
|
78
|
+
End time: 9/24/2023, 10:00:00
|
|
79
|
+
https://atcoder.jp/contests/ahc024
|
|
80
|
+
|
|
81
|
+
There are 4 contests on NowCoder,Codeforces in the next 3 days
|
|
82
|
+
|
|
83
|
+
OJ: NowCoder
|
|
84
|
+
Contest name: 牛客周赛 Round 13
|
|
85
|
+
Rule: IOI
|
|
86
|
+
Start time: 9/24/2023, 11:00:00
|
|
87
|
+
End time: 9/24/2023, 12:30:00
|
|
88
|
+
https://ac.nowcoder.com/acm/contest/65507
|
|
75
89
|
|
|
76
90
|
OJ: Codeforces
|
|
77
|
-
Contest name: Codeforces Round
|
|
91
|
+
Contest name: Educational Codeforces Round 155 (Rated for Div. 2)
|
|
78
92
|
Rule: ICPC
|
|
79
|
-
Start time:
|
|
80
|
-
End time:
|
|
81
|
-
https://codeforces.com/contests/
|
|
93
|
+
Start time: 9/24/2023, 14:35:00
|
|
94
|
+
End time: 9/24/2023, 16:35:00
|
|
95
|
+
https://codeforces.com/contests/1879
|
|
96
|
+
|
|
97
|
+
OJ: Codeforces
|
|
98
|
+
Contest name: Codeforces Round 899 (Div. 2)
|
|
99
|
+
Rule: Codeforces
|
|
100
|
+
Start time: 9/25/2023, 14:35:00
|
|
101
|
+
End time: 9/25/2023, 16:35:00
|
|
102
|
+
https://codeforces.com/contests/1882
|
|
82
103
|
|
|
83
104
|
OJ: Codeforces
|
|
84
|
-
Contest name:
|
|
105
|
+
Contest name: Codeforces Round 900 (Div. 3)
|
|
85
106
|
Rule: ICPC
|
|
86
|
-
Start time:
|
|
87
|
-
End time:
|
|
88
|
-
https://codeforces.com/contests/
|
|
107
|
+
Start time: 9/26/2023, 14:35:00
|
|
108
|
+
End time: 9/26/2023, 16:50:00
|
|
109
|
+
https://codeforces.com/contests/1878
|
|
89
110
|
```
|
|
90
111
|
|
|
91
112
|
</details>
|
|
@@ -94,44 +115,58 @@ https://codeforces.com/contests/1743
|
|
|
94
115
|
<summary> <code>> lsct -o at cf -d 7 -L en</code> </summary>
|
|
95
116
|
|
|
96
117
|
```text
|
|
97
|
-
There are
|
|
98
|
-
|
|
99
|
-
There are 5 contests on AtCoder,Codeforces in the next 7 days
|
|
118
|
+
There are 1 contests is running on AtCoder
|
|
100
119
|
|
|
101
120
|
OJ: AtCoder
|
|
102
|
-
Contest name:
|
|
121
|
+
Contest name: Ⓗ Marubeni Programming Contest 2023 (AtCoder Heuristic Contest 024)
|
|
103
122
|
Rule: AtCoder
|
|
104
|
-
Start time:
|
|
105
|
-
End time:
|
|
106
|
-
https://atcoder.jp/contests/
|
|
123
|
+
Start time: 9/24/2023, 06:00:00
|
|
124
|
+
End time: 9/24/2023, 10:00:00
|
|
125
|
+
https://atcoder.jp/contests/ahc024
|
|
126
|
+
|
|
127
|
+
There are 6 contests on Codeforces,AtCoder in the next 7 days
|
|
107
128
|
|
|
108
129
|
OJ: Codeforces
|
|
109
|
-
Contest name: Codeforces Round
|
|
130
|
+
Contest name: Educational Codeforces Round 155 (Rated for Div. 2)
|
|
110
131
|
Rule: ICPC
|
|
111
|
-
Start time:
|
|
112
|
-
End time:
|
|
113
|
-
https://codeforces.com/contests/
|
|
132
|
+
Start time: 9/24/2023, 14:35:00
|
|
133
|
+
End time: 9/24/2023, 16:35:00
|
|
134
|
+
https://codeforces.com/contests/1879
|
|
114
135
|
|
|
115
136
|
OJ: Codeforces
|
|
116
|
-
Contest name:
|
|
117
|
-
Rule:
|
|
118
|
-
Start time:
|
|
119
|
-
End time:
|
|
120
|
-
https://codeforces.com/contests/
|
|
137
|
+
Contest name: Codeforces Round 899 (Div. 2)
|
|
138
|
+
Rule: Codeforces
|
|
139
|
+
Start time: 9/25/2023, 14:35:00
|
|
140
|
+
End time: 9/25/2023, 16:35:00
|
|
141
|
+
https://codeforces.com/contests/1882
|
|
121
142
|
|
|
122
143
|
OJ: Codeforces
|
|
123
|
-
Contest name:
|
|
144
|
+
Contest name: Codeforces Round 900 (Div. 3)
|
|
124
145
|
Rule: ICPC
|
|
125
|
-
Start time:
|
|
126
|
-
End time:
|
|
127
|
-
https://codeforces.com/contests/
|
|
146
|
+
Start time: 9/26/2023, 14:35:00
|
|
147
|
+
End time: 9/26/2023, 16:50:00
|
|
148
|
+
https://codeforces.com/contests/1878
|
|
128
149
|
|
|
129
150
|
OJ: AtCoder
|
|
130
|
-
Contest name: Ⓐ
|
|
151
|
+
Contest name: Ⓐ AtCoder Beginner Contest 322
|
|
131
152
|
Rule: AtCoder
|
|
132
|
-
Start time:
|
|
133
|
-
End time:
|
|
134
|
-
https://atcoder.jp/contests/
|
|
153
|
+
Start time: 9/30/2023, 12:00:00
|
|
154
|
+
End time: 9/30/2023, 13:40:00
|
|
155
|
+
https://atcoder.jp/contests/abc322
|
|
156
|
+
|
|
157
|
+
OJ: Codeforces
|
|
158
|
+
Contest name: Codeforces Round 901 (Div. 1)
|
|
159
|
+
Rule: Codeforces
|
|
160
|
+
Start time: 9/30/2023, 14:35:00
|
|
161
|
+
End time: 9/30/2023, 17:35:00
|
|
162
|
+
https://codeforces.com/contests/1874
|
|
163
|
+
|
|
164
|
+
OJ: Codeforces
|
|
165
|
+
Contest name: Codeforces Round 901 (Div. 2)
|
|
166
|
+
Rule: Codeforces
|
|
167
|
+
Start time: 9/30/2023, 14:35:00
|
|
168
|
+
End time: 9/30/2023, 17:35:00
|
|
169
|
+
https://codeforces.com/contests/1875
|
|
135
170
|
```
|
|
136
171
|
|
|
137
172
|
</details>
|
|
@@ -141,103 +176,144 @@ https://atcoder.jp/contests/abc274
|
|
|
141
176
|
|
|
142
177
|
```json
|
|
143
178
|
{
|
|
144
|
-
"running": [
|
|
179
|
+
"running": [
|
|
180
|
+
{
|
|
181
|
+
"ojName": "AtCoder",
|
|
182
|
+
"name": "Ⓗ Marubeni Programming Contest 2023 (AtCoder Heuristic Contest 024)",
|
|
183
|
+
"rule": "AtCoder",
|
|
184
|
+
"startTime": "2023-09-24T06:00:00.000Z",
|
|
185
|
+
"endTime": "2023-09-24T10:00:00.000Z",
|
|
186
|
+
"url": "https://atcoder.jp/contests/ahc024"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
145
189
|
"upcoming": [
|
|
146
190
|
{
|
|
147
191
|
"ojName": "AtCoder",
|
|
148
|
-
"name": "Ⓐ AtCoder
|
|
192
|
+
"name": "Ⓐ AtCoder Beginner Contest 322",
|
|
149
193
|
"rule": "AtCoder",
|
|
150
|
-
"startTime": "
|
|
151
|
-
"endTime": "
|
|
152
|
-
"url": "https://atcoder.jp/contests/
|
|
194
|
+
"startTime": "2023-09-30T12:00:00.000Z",
|
|
195
|
+
"endTime": "2023-09-30T13:40:00.000Z",
|
|
196
|
+
"url": "https://atcoder.jp/contests/abc322"
|
|
153
197
|
},
|
|
154
198
|
{
|
|
155
199
|
"ojName": "AtCoder",
|
|
156
|
-
"name": "Ⓐ
|
|
200
|
+
"name": "Ⓐ UNIQUE VISION Programming Contest 2023 Autumn(AtCoder Beginner Contest 323)",
|
|
157
201
|
"rule": "AtCoder",
|
|
158
|
-
"startTime": "
|
|
159
|
-
"endTime": "
|
|
160
|
-
"url": "https://atcoder.jp/contests/
|
|
202
|
+
"startTime": "2023-10-07T12:00:00.000Z",
|
|
203
|
+
"endTime": "2023-10-07T13:40:00.000Z",
|
|
204
|
+
"url": "https://atcoder.jp/contests/abc323"
|
|
161
205
|
},
|
|
162
206
|
{
|
|
163
207
|
"ojName": "AtCoder",
|
|
164
|
-
"name": "Ⓐ AtCoder
|
|
208
|
+
"name": "Ⓐ AtCoder Regular Contest 166",
|
|
165
209
|
"rule": "AtCoder",
|
|
166
|
-
"startTime": "
|
|
167
|
-
"endTime": "
|
|
168
|
-
"url": "https://atcoder.jp/contests/
|
|
210
|
+
"startTime": "2023-10-08T12:00:00.000Z",
|
|
211
|
+
"endTime": "2023-10-08T14:00:00.000Z",
|
|
212
|
+
"url": "https://atcoder.jp/contests/arc166"
|
|
169
213
|
},
|
|
170
214
|
{
|
|
171
215
|
"ojName": "AtCoder",
|
|
172
|
-
"name": "Ⓗ
|
|
216
|
+
"name": "Ⓗ AtCoder Heuristic Contest 025",
|
|
173
217
|
"rule": "AtCoder",
|
|
174
|
-
"startTime": "
|
|
175
|
-
"endTime": "
|
|
176
|
-
"url": "https://atcoder.jp/contests/
|
|
218
|
+
"startTime": "2023-10-14T03:00:00.000Z",
|
|
219
|
+
"endTime": "2023-10-22T10:00:00.000Z",
|
|
220
|
+
"url": "https://atcoder.jp/contests/ahc025"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"ojName": "AtCoder",
|
|
224
|
+
"name": "Ⓐ Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324)",
|
|
225
|
+
"rule": "AtCoder",
|
|
226
|
+
"startTime": "2023-10-14T12:00:00.000Z",
|
|
227
|
+
"endTime": "2023-10-14T13:40:00.000Z",
|
|
228
|
+
"url": "https://atcoder.jp/contests/abc324"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"ojName": "AtCoder",
|
|
232
|
+
"name": "Ⓐ AtCoder Regular Contest 167",
|
|
233
|
+
"rule": "AtCoder",
|
|
234
|
+
"startTime": "2023-10-15T12:00:00.000Z",
|
|
235
|
+
"endTime": "2023-10-15T14:00:00.000Z",
|
|
236
|
+
"url": "https://atcoder.jp/contests/arc167"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"ojName": "AtCoder",
|
|
240
|
+
"name": "Ⓐ Panasonic Programming Contest 2023(AtCoder Beginner Contest 326)",
|
|
241
|
+
"rule": "AtCoder",
|
|
242
|
+
"startTime": "2023-10-28T12:00:00.000Z",
|
|
243
|
+
"endTime": "2023-10-28T13:40:00.000Z",
|
|
244
|
+
"url": "https://atcoder.jp/contests/abc326"
|
|
177
245
|
},
|
|
178
246
|
{
|
|
179
247
|
"ojName": "Codeforces",
|
|
180
|
-
"name": "Codeforces Round
|
|
248
|
+
"name": "Educational Codeforces Round 155 (Rated for Div. 2)",
|
|
181
249
|
"rule": "ICPC",
|
|
182
|
-
"startTime": "
|
|
183
|
-
"endTime": "
|
|
184
|
-
"url": "https://codeforces.com/contests/
|
|
250
|
+
"startTime": "2023-09-24T14:35:00.000Z",
|
|
251
|
+
"endTime": "2023-09-24T16:35:00.000Z",
|
|
252
|
+
"url": "https://codeforces.com/contests/1879"
|
|
185
253
|
},
|
|
186
254
|
{
|
|
187
255
|
"ojName": "Codeforces",
|
|
188
|
-
"name": "
|
|
189
|
-
"rule": "
|
|
190
|
-
"startTime": "
|
|
191
|
-
"endTime": "
|
|
192
|
-
"url": "https://codeforces.com/contests/
|
|
256
|
+
"name": "Codeforces Round 899 (Div. 2)",
|
|
257
|
+
"rule": "Codeforces",
|
|
258
|
+
"startTime": "2023-09-25T14:35:00.000Z",
|
|
259
|
+
"endTime": "2023-09-25T16:35:00.000Z",
|
|
260
|
+
"url": "https://codeforces.com/contests/1882"
|
|
193
261
|
},
|
|
194
262
|
{
|
|
195
263
|
"ojName": "Codeforces",
|
|
196
|
-
"name": "
|
|
264
|
+
"name": "Codeforces Round 900 (Div. 3)",
|
|
197
265
|
"rule": "ICPC",
|
|
198
|
-
"startTime": "
|
|
199
|
-
"endTime": "
|
|
200
|
-
"url": "https://codeforces.com/contests/
|
|
266
|
+
"startTime": "2023-09-26T14:35:00.000Z",
|
|
267
|
+
"endTime": "2023-09-26T16:50:00.000Z",
|
|
268
|
+
"url": "https://codeforces.com/contests/1878"
|
|
201
269
|
},
|
|
202
270
|
{
|
|
203
271
|
"ojName": "Codeforces",
|
|
204
|
-
"name": "Codeforces Round (Div.
|
|
272
|
+
"name": "Codeforces Round 901 (Div. 1)",
|
|
205
273
|
"rule": "Codeforces",
|
|
206
|
-
"startTime": "
|
|
207
|
-
"endTime": "
|
|
208
|
-
"url": "https://codeforces.com/contests/
|
|
274
|
+
"startTime": "2023-09-30T14:35:00.000Z",
|
|
275
|
+
"endTime": "2023-09-30T17:35:00.000Z",
|
|
276
|
+
"url": "https://codeforces.com/contests/1874"
|
|
209
277
|
},
|
|
210
278
|
{
|
|
211
279
|
"ojName": "Codeforces",
|
|
212
|
-
"name": "Codeforces Round (Div.
|
|
280
|
+
"name": "Codeforces Round 901 (Div. 2)",
|
|
213
281
|
"rule": "Codeforces",
|
|
214
|
-
"startTime": "
|
|
215
|
-
"endTime": "
|
|
216
|
-
"url": "https://codeforces.com/contests/
|
|
282
|
+
"startTime": "2023-09-30T14:35:00.000Z",
|
|
283
|
+
"endTime": "2023-09-30T17:35:00.000Z",
|
|
284
|
+
"url": "https://codeforces.com/contests/1875"
|
|
217
285
|
},
|
|
218
286
|
{
|
|
219
287
|
"ojName": "Codeforces",
|
|
220
|
-
"name": "Codeforces Round (Div.
|
|
288
|
+
"name": "Codeforces Round (Div. 1)",
|
|
221
289
|
"rule": "Codeforces",
|
|
222
|
-
"startTime": "
|
|
223
|
-
"endTime": "
|
|
224
|
-
"url": "https://codeforces.com/contests/
|
|
290
|
+
"startTime": "2023-10-08T09:05:00.000Z",
|
|
291
|
+
"endTime": "2023-10-08T11:35:00.000Z",
|
|
292
|
+
"url": "https://codeforces.com/contests/1876"
|
|
225
293
|
},
|
|
226
294
|
{
|
|
227
295
|
"ojName": "Codeforces",
|
|
228
|
-
"name": "Codeforces Round (Div.
|
|
296
|
+
"name": "Codeforces Round (Div. 2)",
|
|
229
297
|
"rule": "Codeforces",
|
|
230
|
-
"startTime": "
|
|
231
|
-
"endTime": "
|
|
232
|
-
"url": "https://codeforces.com/contests/
|
|
298
|
+
"startTime": "2023-10-08T09:05:00.000Z",
|
|
299
|
+
"endTime": "2023-10-08T11:35:00.000Z",
|
|
300
|
+
"url": "https://codeforces.com/contests/1877"
|
|
233
301
|
},
|
|
234
302
|
{
|
|
235
303
|
"ojName": "Codeforces",
|
|
236
|
-
"name": "Codeforces Round (Div.
|
|
237
|
-
"rule": "
|
|
238
|
-
"startTime": "
|
|
239
|
-
"endTime": "
|
|
240
|
-
"url": "https://codeforces.com/contests/
|
|
304
|
+
"name": "Codeforces Round (Div. 3)",
|
|
305
|
+
"rule": "ICPC",
|
|
306
|
+
"startTime": "2023-10-12T14:35:00.000Z",
|
|
307
|
+
"endTime": "2023-10-12T16:50:00.000Z",
|
|
308
|
+
"url": "https://codeforces.com/contests/1881"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"ojName": "Codeforces",
|
|
312
|
+
"name": "Codeforces Round (Div. 3)",
|
|
313
|
+
"rule": "ICPC",
|
|
314
|
+
"startTime": "2023-10-22T12:05:00.000Z",
|
|
315
|
+
"endTime": "2023-10-22T14:20:00.000Z",
|
|
316
|
+
"url": "https://codeforces.com/contests/1883"
|
|
241
317
|
}
|
|
242
318
|
]
|
|
243
319
|
}
|
package/dist/lib/contest.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LeDuo: From Luogu OJ
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type rule = "OI" | "IOI" | "ICPC" | "LeDuo" | "Codeforces" | "AtCoder";
|
|
5
5
|
export interface Contest {
|
|
6
6
|
ojName: string;
|
|
7
7
|
name: string;
|
package/dist/lib/oj/nowcoder.js
CHANGED
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.nc = void 0;
|
|
16
16
|
const axios_1 = __importDefault(require("axios"));
|
|
17
17
|
const cheerio_1 = require("cheerio");
|
|
18
|
-
const
|
|
18
|
+
const html_entities_1 = require("html-entities");
|
|
19
19
|
var topCategoryFilter;
|
|
20
20
|
(function (topCategoryFilter) {
|
|
21
21
|
topCategoryFilter[topCategoryFilter["NOWCODERSERIES"] = 13] = "NOWCODERSERIES";
|
|
@@ -49,7 +49,7 @@ exports.nc = {
|
|
|
49
49
|
return res.filter(res => res.signUpEndCountDownTime > 0).map((res) => {
|
|
50
50
|
return {
|
|
51
51
|
ojName: exports.nc.name,
|
|
52
|
-
name: (0,
|
|
52
|
+
name: (0, html_entities_1.decode)(res.contestName),
|
|
53
53
|
rule: ruleRecord[res.type],
|
|
54
54
|
startTime: new Date(res.contestStartTime),
|
|
55
55
|
endTime: new Date(res.contestEndTime),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nowcoder.js","sourceRoot":"","sources":["../../../src/lib/oj/nowcoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,qCAA+B;AAG/B,
|
|
1
|
+
{"version":3,"file":"nowcoder.js","sourceRoot":"","sources":["../../../src/lib/oj/nowcoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,qCAA+B;AAG/B,iDAAuC;AA8CvC,IAAK,iBAIJ;AAJD,WAAK,iBAAiB;IAElB,8EAAmB,CAAA;IACnB,4EAAa,CAAA;AACjB,CAAC,EAJI,iBAAiB,KAAjB,iBAAiB,QAIrB;AAED,MAAM,GAAG,GAAG,+CAA+C,CAAC;AAE5D,SAAe,aAAa,CAAC,GAAsB;;QAE/C,MAAM,IAAI,GAAG,CAAC,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,GAAG,sBAAsB,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,MAAM,CAAC,GAA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
CHANGED
package/dist/locale/index.js
CHANGED
|
@@ -39,7 +39,7 @@ function getLangDict(language) {
|
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
if (!exports.langList.includes(language))
|
|
41
41
|
throw new Error(`Illegal language ${language}, the allowed languages are ${exports.langList}`);
|
|
42
|
-
return Promise.resolve().then(
|
|
42
|
+
return Promise.resolve(`${`./${language}.json`}`).then(s => __importStar(require(s)));
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
exports.getLangDict = getLangDict;
|
package/dist/locale/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locale/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAAiC;AAEpB,QAAA,QAAQ,GAAG,IAAA,gBAAW,EAAC,GAAG,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAgBlJ,SAAsB,WAAW,CAAC,QAAgB;;QAE9C,IAAG,CAAC,gBAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,QAAQ,+BAA+B,gBAAQ,EAAE,CAAC,CAAC;QACxH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/locale/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAAiC;AAEpB,QAAA,QAAQ,GAAG,IAAA,gBAAW,EAAC,GAAG,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAgBlJ,SAAsB,WAAW,CAAC,QAAgB;;QAE9C,IAAG,CAAC,gBAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,QAAQ,+BAA+B,gBAAQ,EAAE,CAAC,CAAC;QACxH,0BAAc,KAAK,QAAQ,OAAO,wCAAE;IACxC,CAAC;CAAA;AAJD,kCAIC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const package_json_1 = require("../package.json");
|
|
9
|
+
const server_1 = __importDefault(require("./server"));
|
|
10
|
+
const express_1 = __importDefault(require("express"));
|
|
11
|
+
const command = new commander_1.Command()
|
|
12
|
+
.name(Object.keys(package_json_1.bin)[1])
|
|
13
|
+
.version(package_json_1.version)
|
|
14
|
+
.option("-h, --host, <host>", "Host to listen on", "0.0.0.0")
|
|
15
|
+
.option("-p, --port, <port>", "Port to listen on", "8080");
|
|
16
|
+
command.parse();
|
|
17
|
+
const host = command.opts().host;
|
|
18
|
+
let port = command.opts().port;
|
|
19
|
+
port = parseInt(port, 10);
|
|
20
|
+
server_1.default.use(express_1.default.static(`${__dirname}/../public`));
|
|
21
|
+
server_1.default.listen(port, host, () => {
|
|
22
|
+
const logURL = `http://${host === "0.0.0.0" ? "127.0.0.1" : host}:${port}/`;
|
|
23
|
+
console.log(`LSCT server v${package_json_1.version} listening on ${logURL}`);
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=server-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-cli.js","sourceRoot":"","sources":["../src/server-cli.ts"],"names":[],"mappings":";;;;;;AACA,yCAAoC;AACpC,kDAA+C;AAC/C,sDAA2B;AAC3B,sDAA8B;AAE9B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE;KACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACzB,OAAO,CAAC,sBAAO,CAAC;KAChB,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,SAAS,CAAC;KAC5D,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAC/D,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,IAAc,CAAC;AAC3C,IAAI,IAAI,GAAoB,OAAO,CAAC,IAAI,EAAE,CAAC,IAAc,CAAC;AAC1D,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAE1B,gBAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,MAAM,CAAC,GAAG,SAAS,YAAY,CAAC,CAAC,CAAC;AAElD,gBAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;IAExB,MAAM,MAAM,GAAG,UAAU,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,gBAAgB,sBAAO,iBAAiB,MAAM,EAAE,CAAC,CAAC;AAClE,CAAC,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
declare const app: import("express-serve-static-core").Express;
|
|
2
|
+
export = app;
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -12,7 +11,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
13
|
};
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
14
|
const express_1 = __importDefault(require("express"));
|
|
17
15
|
const _1 = __importDefault(require("."));
|
|
18
16
|
const oj_1 = require("./lib/oj");
|
|
@@ -20,10 +18,8 @@ const locale_1 = require("./locale");
|
|
|
20
18
|
const ics_1 = require("ics");
|
|
21
19
|
const pangu_1 = __importDefault(require("pangu"));
|
|
22
20
|
const crypto_1 = require("crypto");
|
|
23
|
-
const commander_1 = require("commander");
|
|
24
|
-
const package_json_1 = require("../package.json");
|
|
25
|
-
const fs_1 = require("fs");
|
|
26
21
|
const await_lock_1 = __importDefault(require("await-lock"));
|
|
22
|
+
const ioredis_1 = __importDefault(require("ioredis"));
|
|
27
23
|
const app = (0, express_1.default)();
|
|
28
24
|
const logger = () => {
|
|
29
25
|
return (req, res, next) => {
|
|
@@ -42,13 +38,8 @@ const logger = () => {
|
|
|
42
38
|
next();
|
|
43
39
|
};
|
|
44
40
|
};
|
|
45
|
-
const web = (0, fs_1.readFileSync)(`${__dirname}/server.html`).toString();
|
|
46
41
|
app.set("trust proxy", true);
|
|
47
42
|
app.use(logger());
|
|
48
|
-
app.get("/", (req, res) => {
|
|
49
|
-
res.set("Content-Type", "text/html");
|
|
50
|
-
res.send(web);
|
|
51
|
-
});
|
|
52
43
|
app.get("/ics", (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
44
|
const { language, l, ojs, o } = req.query;
|
|
54
45
|
const lArg = language || l || "zh-CN";
|
|
@@ -73,6 +64,29 @@ const contestsCache = {
|
|
|
73
64
|
contests: [],
|
|
74
65
|
lastUpdate: 0
|
|
75
66
|
};
|
|
67
|
+
let redis = undefined;
|
|
68
|
+
const cacheKey = "lsct:cache";
|
|
69
|
+
function exportContestCache() {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
yield redis.set(cacheKey, JSON.stringify(contestsCache));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function importContestCache() {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
redis = new ioredis_1.default(process.env.REDIS_URL);
|
|
77
|
+
const payload = yield redis.get(cacheKey);
|
|
78
|
+
if (payload) {
|
|
79
|
+
const obj = JSON.parse(payload);
|
|
80
|
+
contestsCache.lastUpdate = obj.lastUpdate;
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
+
contestsCache.contests = obj.contests.map((c) => {
|
|
83
|
+
c.startTime = new Date(c.startTime);
|
|
84
|
+
c.endTime = new Date(c.endTime);
|
|
85
|
+
return c;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
76
90
|
const lock = new await_lock_1.default();
|
|
77
91
|
function icsPostProcess(value) {
|
|
78
92
|
return value
|
|
@@ -93,12 +107,18 @@ function icsPostProcess(value) {
|
|
|
93
107
|
function checkCache() {
|
|
94
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
109
|
yield lock.acquireAsync();
|
|
110
|
+
if (process.env.VERCEL) {
|
|
111
|
+
yield importContestCache();
|
|
112
|
+
}
|
|
96
113
|
try {
|
|
97
114
|
if (contestsCache.lastUpdate < Date.now() - 1000 * 60 * 5) {
|
|
98
115
|
const c = yield new _1.default({ days: -1 }).getContests();
|
|
99
116
|
contestsCache.contests = c.running.concat(...c.upcoming);
|
|
100
117
|
contestsCache.contests = contestsCache.contests.filter(c => c.endTime.getTime() - c.startTime.getTime() < 1000 * 60 * 60 * 24 * 2); // ignore too long contests
|
|
101
118
|
contestsCache.lastUpdate = Date.now();
|
|
119
|
+
if (process.env.VERCEL) {
|
|
120
|
+
yield exportContestCache();
|
|
121
|
+
}
|
|
102
122
|
}
|
|
103
123
|
}
|
|
104
124
|
finally {
|
|
@@ -141,17 +161,5 @@ function getIcs(lang, ojs) {
|
|
|
141
161
|
return icsPostProcess(value);
|
|
142
162
|
});
|
|
143
163
|
}
|
|
144
|
-
|
|
145
|
-
.name(Object.keys(package_json_1.bin)[1])
|
|
146
|
-
.version(package_json_1.version)
|
|
147
|
-
.option("-h, --host, <host>", "Host to listen on", "0.0.0.0")
|
|
148
|
-
.option("-p, --port, <port>", "Port to listen on", "8080");
|
|
149
|
-
command.parse();
|
|
150
|
-
const host = command.opts().host;
|
|
151
|
-
let port = command.opts().port;
|
|
152
|
-
port = parseInt(port, 10);
|
|
153
|
-
app.listen(port, host, () => {
|
|
154
|
-
const logURL = `http://${host === "0.0.0.0" ? "127.0.0.1" : host}:${port}/`;
|
|
155
|
-
console.log(`LSCT server v${package_json_1.version} listening on ${logURL}`);
|
|
156
|
-
});
|
|
164
|
+
module.exports = app;
|
|
157
165
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,yCAAwC;AACxC,iCAAiC;AACjC,qCAAuC;AACvC,6BAA6E;AAC7E,kDAA0B;AAC1B,mCAAoC;AACpC,4DAAmC;AACnC,sDAA4B;AAE5B,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;AAEtB,MAAM,MAAM,GAAG,GAAG,EAAE;IAEhB,OAAO,CAAC,GAAo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,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;YACvC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACf,MAAM,WAAW,GAAG,eAAK,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YACjD,MAAM,GAAG,GAAoB;gBACzB,KAAK,EAAE,IAAA,6BAAuB,EAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC;gBAC9D,eAAe,EAAE,OAAO;gBACxB,GAAG,EAAE,IAAA,6BAAuB,EAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC;gBAC1D,aAAa,EAAE,OAAO;gBACtB,OAAO,EAAE,MAAM;gBACf,SAAS,EAAE,yBAAyB;gBACpC,KAAK,EAAE,CAAC,CAAC,IAAI;gBACb,QAAQ,EAAE,CAAC,CAAC,MAAM;gBAClB,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;gBACpB,GAAG,EAAE,GAAG,IAAA,mBAAU,GAAE,OAAO;gBAC3B,WAAW;aACd,CAAC;YACF,OAAO,GAAG,CAAC;QACf,CAAC,CAAC,CAAC;QACH,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAA,kBAAY,EAAC,MAAM,CAAC,CAAC;QAC9C,IAAG,KAAK;YAAE,MAAM,KAAK,CAAC;QACtB,IAAG,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACnD,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;CAAA;AAED,iBAAS,GAAG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lscontests",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "A tool to get information about the contests on each OJ",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -18,50 +18,54 @@
|
|
|
18
18
|
"main": "./dist/index.js",
|
|
19
19
|
"bin": {
|
|
20
20
|
"lsct": "./dist/cli.js",
|
|
21
|
-
"lsct-s": "./dist/server.js"
|
|
21
|
+
"lsct-s": "./dist/server-cli.js"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"public"
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
27
|
-
"prebuild": "rimraf ./dist
|
|
28
|
-
"postbuild": "cpy --flat src/server.html dist",
|
|
28
|
+
"prebuild": "rimraf ./dist",
|
|
29
29
|
"build": "tsc -p src",
|
|
30
30
|
"clean": "rimraf ./dist ./docs ./node_modules",
|
|
31
31
|
"docs": "typedoc",
|
|
32
32
|
"lint": "eslint . && markdownlint .",
|
|
33
33
|
"lint:fix": "eslint . --fix && markdownlint . --fix",
|
|
34
34
|
"start": "tsx src/cli.ts",
|
|
35
|
-
"start-s": "tsx src/server.ts"
|
|
35
|
+
"start-s": "tsx src/server.ts",
|
|
36
|
+
"vercel-dev": "vercel dev"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"await-lock": "^2.2.2",
|
|
39
|
-
"axios": "^1.
|
|
40
|
-
"axios-retry": "^3.
|
|
41
|
-
"cheerio": "^1.0.0-rc.
|
|
42
|
-
"commander": "^
|
|
43
|
-
"express": "^4.18.
|
|
44
|
-
"
|
|
40
|
+
"axios": "^1.5.0",
|
|
41
|
+
"axios-retry": "^3.8.0",
|
|
42
|
+
"cheerio": "^1.0.0-rc.12",
|
|
43
|
+
"commander": "^11.0.0",
|
|
44
|
+
"express": "^4.18.2",
|
|
45
|
+
"html-entities": "^2.4.0",
|
|
46
|
+
"ics": "^3.5.0",
|
|
47
|
+
"ioredis": "^5.3.2",
|
|
45
48
|
"lodash": "^4.17.21",
|
|
46
49
|
"pangu": "^4.0.7",
|
|
47
|
-
"winston": "^3.
|
|
50
|
+
"winston": "^3.10.0"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
|
-
"@types/express": "^4.17.
|
|
51
|
-
"@types/lodash": "^4.14.
|
|
52
|
-
"@types/node": "^
|
|
53
|
+
"@types/express": "^4.17.17",
|
|
54
|
+
"@types/lodash": "^4.14.199",
|
|
55
|
+
"@types/node": "^20.6.3",
|
|
53
56
|
"@types/pangu": "^4.0.0",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
55
|
-
"@typescript-eslint/parser": "^
|
|
56
|
-
"
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
58
|
+
"@typescript-eslint/parser": "^6.7.2",
|
|
59
|
+
"@vercel/ncc": "^0.38.0",
|
|
60
|
+
"cpy-cli": "^5.0.0",
|
|
57
61
|
"cz-conventional-changelog": "3.3.0",
|
|
58
|
-
"eslint": "^8.
|
|
59
|
-
"markdownlint-cli": "^0.
|
|
60
|
-
"rimraf": "^
|
|
61
|
-
"tsx": "^3.
|
|
62
|
-
"typedoc": "^0.
|
|
63
|
-
"typedoc-plugin-extras": "^
|
|
64
|
-
"typescript": "^
|
|
62
|
+
"eslint": "^8.50.0",
|
|
63
|
+
"markdownlint-cli": "^0.37.0",
|
|
64
|
+
"rimraf": "^5.0.1",
|
|
65
|
+
"tsx": "^3.12.10",
|
|
66
|
+
"typedoc": "^0.25.1",
|
|
67
|
+
"typedoc-plugin-extras": "^3.0.0",
|
|
68
|
+
"typescript": "^5.2.2"
|
|
65
69
|
},
|
|
66
70
|
"config": {
|
|
67
71
|
"commitizen": {
|
|
@@ -70,11 +70,6 @@
|
|
|
70
70
|
checked/>
|
|
71
71
|
<label class="form-check-label" for="zhCN">zh-CN</label>
|
|
72
72
|
</div>
|
|
73
|
-
<div class="form-check">
|
|
74
|
-
<input class="form-check-input" type="radio" name="lang"
|
|
75
|
-
id="zhNE"/>
|
|
76
|
-
<label class="form-check-label" for="zhNE">zh-NE</label>
|
|
77
|
-
</div>
|
|
78
73
|
<div class="form-check">
|
|
79
74
|
<input class="form-check-input" type="radio" name="lang"
|
|
80
75
|
id="zhTW"/>
|
|
@@ -97,14 +92,10 @@
|
|
|
97
92
|
</div>
|
|
98
93
|
</div>
|
|
99
94
|
</main>
|
|
100
|
-
<script src="https://cdnjs.loli.net/ajax/libs/mdb-ui-kit/4.1
|
|
101
|
-
referrerpolicy="no-referrer"
|
|
95
|
+
<script src="https://cdnjs.loli.net/ajax/libs/mdb-ui-kit/6.4.1/mdb.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"
|
|
102
96
|
></script>
|
|
103
|
-
<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.
|
|
104
|
-
|
|
105
|
-
<script src="https://cdnjs.loli.net/ajax/libs/clipboard.js/2.0.10/clipboard.min.js"
|
|
106
|
-
crossorigin="anonymous"
|
|
107
|
-
referrerpolicy="no-referrer"></script>
|
|
97
|
+
<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.7.1/jquery.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
98
|
+
<script src="https://cdnjs.loli.net/ajax/libs/clipboard.js/2.0.11/clipboard.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
108
99
|
<script>
|
|
109
100
|
function updateURL()
|
|
110
101
|
{
|
|
@@ -130,7 +121,9 @@
|
|
|
130
121
|
if(lc) ojs.push("lc");
|
|
131
122
|
if(lg) ojs.push("lg");
|
|
132
123
|
if(nc) ojs.push("nc");
|
|
133
|
-
|
|
124
|
+
if(ojs.length > 0) {
|
|
125
|
+
args.append("o", ojs.join(","));
|
|
126
|
+
}
|
|
134
127
|
}
|
|
135
128
|
|
|
136
129
|
//process lang
|
|
@@ -171,7 +164,6 @@
|
|
|
171
164
|
{
|
|
172
165
|
copy.tooltip("hide");
|
|
173
166
|
}, 1000);
|
|
174
|
-
fetch(url);
|
|
175
167
|
}
|
|
176
168
|
});
|
|
177
169
|
}
|
package/dist/locale/zh-NE.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"runnning": "搁 ${oj} 上有 ${contestCount} 场比赛正偷摸干着呢",
|
|
3
|
-
"norunning": "这前搁 ${oj} 上属实是没比赛打",
|
|
4
|
-
"upcoming": "之后 ${days} 天搁 ${oj} 上拢共 ${contestCount} 场比赛",
|
|
5
|
-
"upcoming_all": "往后搁 ${oj} 上有 ${contestCount} 场比赛",
|
|
6
|
-
"noupcoming": "没成想往后 ${days} 天搁 ${oj} 上没比赛打啊",
|
|
7
|
-
"noupcoming_all": "将来搁 ${oj} 上没比赛",
|
|
8
|
-
"ojName": "搁哪",
|
|
9
|
-
"name": "叫啥",
|
|
10
|
-
"rule": "咋个整法",
|
|
11
|
-
"startTime": "啥前开始",
|
|
12
|
-
"endTime": "多前完事"
|
|
13
|
-
}
|