{"id":16588157,"url":"https://github.com/stableagoh/lscontests","last_synced_at":"2025-03-21T13:31:02.324Z","repository":{"id":36981646,"uuid":"488557906","full_name":"StableAgOH/lscontests","owner":"StableAgOH","description":"A tool to get information about the contests on each OJ","archived":false,"fork":false,"pushed_at":"2025-03-01T02:37:23.000Z","size":1152,"stargazers_count":3,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-18T01:42:41.843Z","etag":null,"topics":["atcoder","cli","codeforces","competitive-programming","luogu","nowcoder","typescript"],"latest_commit_sha":null,"homepage":"https://lsct.stagoh.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StableAgOH.png","metadata":{"files":{"readme":"README-zh-CN.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-04T11:16:31.000Z","updated_at":"2024-12-01T04:37:08.000Z","dependencies_parsed_at":"2023-09-24T08:44:27.610Z","dependency_job_id":"602945f6-31a3-43eb-896f-4c48e5a06ae6","html_url":"https://github.com/StableAgOH/lscontests","commit_stats":{"total_commits":290,"total_committers":7,"mean_commits":41.42857142857143,"dds":0.6068965517241379,"last_synced_commit":"0f3506a9774085d4ca1deb48c54235a95bc39a89"},"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StableAgOH%2Flscontests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StableAgOH%2Flscontests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StableAgOH%2Flscontests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StableAgOH%2Flscontests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StableAgOH","download_url":"https://codeload.github.com/StableAgOH/lscontests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244806070,"owners_count":20513372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atcoder","cli","codeforces","competitive-programming","luogu","nowcoder","typescript"],"created_at":"2024-10-11T22:56:00.711Z","updated_at":"2025-03-21T13:31:02.003Z","avatar_url":"https://github.com/StableAgOH.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lscontests\n\n[![GitHub Repo stars](https://img.shields.io/github/stars/StableAgOH/lscontests?style=social)](https://github.com/StableAgOH/lscontests)\n[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/StableAgOH/lscontests?logo=github)](https://github.com/StableAgOH/lscontests)\n[![License](https://img.shields.io/github/license/StableAgOH/lscontests)](https://github.com/StableAgOH/lscontests)\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n\n[![npm](https://img.shields.io/npm/v/lscontests?logo=npm)](https://www.npmjs.com/package/lscontests)\n[![npm](https://img.shields.io/npm/dw/lscontests?logo=npm)](https://www.npmjs.com/package/lscontests)\n\n一个用来获取各大 OJ 上比赛信息的工具。\n\n[English Document](./README.md)\n\n## 如何安装\n\n### 只想使用 CLI\n\n如果你是 npm 用户: `npm install -g lscontests`\n\n如果你是 yarn 用户: `yarn global add lscontests`\n\n### 向你的包中添加 *lscontests*\n\n如果你是 npm 用户: `npm install lscontests --save`\n\n如果你是 yarn 用户: `yarn add lscontests`\n\n## 如何使用\n\n### CLI\n\n你可以非常轻松地使用 CLI 来获取比赛信息。\n\n\u003c!-- block_help begin --\u003e\n```text\nUsage: lsct [options]\n\nOptions:\n  -V, --version          output the version number\n  -d, --days, \u003cday\u003e      number of days to display, set to -1 to get all\n                         contests infomation (default: \"3\")\n  -l, --list             list all supported OJ and it's abbreviation\n  -s, --silent           do not print log\n  -o, --oj \u003cojs...\u003e      OJs to display (choices: \"at\", \"cf\", \"lc\", \"lg\", \"nc\")\n  -r, --raw              print raw contest list\n  -L, --language \u003clang\u003e  set output language (choices: \"en\", \"zh-CN\", \"zh-TW\",\n                         default: \"zh-CN\")\n  --no-sort              do not sort by contests start time, but by OJ order\n  --no-running           do not list all running contests\n  --no-upcoming          do not list all upcoming contests\n  -h, --help             display help for command\n```\n\u003c!-- block_help end --\u003e\n\n来欣赏一下它的表演：\n\n\u003c!-- block_cli begin --\u003e\n（*以下内容是使用 [semantic-release](https://github.com/semantic-release/semantic-release) 于 Sun, 24 Sep 2023 07:10:49 GMT 自动生成的*）\n\n\u003cdetails\u003e\n\u003csummary\u003e \u003ccode\u003e\u003e lsct \u003c/code\u003e \u003c/summary\u003e\n\n```text\n在 Luogu,AtCoder 上有 2 场正在进行的比赛\n\n比赛平台: Luogu\n比赛名称: [ICPC2021 Macao R] ICPC2021 区域赛澳门站重现赛\n赛制: ICPC\n开始时间: 9/24/2023, 05:00:00\n结束时间: 9/24/2023, 10:00:00\nhttps://www.luogu.com.cn/contest/134300\n\n比赛平台: AtCoder\n比赛名称: Ⓗ  Marubeni Programming Contest 2023 (AtCoder Heuristic Contest 024)\n赛制: AtCoder\n开始时间: 9/24/2023, 06:00:00\n结束时间: 9/24/2023, 10:00:00\nhttps://atcoder.jp/contests/ahc024\n\n接下来的 3 天内在 NowCoder,Codeforces 上有 4 场比赛\n\n比赛平台: NowCoder\n比赛名称：牛客周赛 Round 13\n赛制: IOI\n开始时间: 9/24/2023, 11:00:00\n结束时间: 9/24/2023, 12:30:00\nhttps://ac.nowcoder.com/acm/contest/65507\n\n比赛平台: Codeforces\n比赛名称: Educational Codeforces Round 155 (Rated for Div. 2)\n赛制: ICPC\n开始时间: 9/24/2023, 14:35:00\n结束时间: 9/24/2023, 16:35:00\nhttps://codeforces.com/contests/1879\n\n比赛平台: Codeforces\n比赛名称: Codeforces Round 899 (Div. 2)\n赛制: Codeforces\n开始时间: 9/25/2023, 14:35:00\n结束时间: 9/25/2023, 16:35:00\nhttps://codeforces.com/contests/1882\n\n比赛平台: Codeforces\n比赛名称: Codeforces Round 900 (Div. 3)\n赛制: ICPC\n开始时间: 9/26/2023, 14:35:00\n结束时间: 9/26/2023, 16:50:00\nhttps://codeforces.com/contests/1878\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e \u003ccode\u003e\u003e lsct -o at cf -d 7\u003c/code\u003e \u003c/summary\u003e\n\n```text\n在 AtCoder 上有 1 场正在进行的比赛\n\n比赛平台: AtCoder\n比赛名称: Ⓗ  Marubeni Programming Contest 2023 (AtCoder Heuristic Contest 024)\n赛制: AtCoder\n开始时间: 9/24/2023, 06:00:00\n结束时间: 9/24/2023, 10:00:00\nhttps://atcoder.jp/contests/ahc024\n\n接下来的 7 天内在 Codeforces,AtCoder 上有 6 场比赛\n\n比赛平台: Codeforces\n比赛名称: Educational Codeforces Round 155 (Rated for Div. 2)\n赛制: ICPC\n开始时间: 9/24/2023, 14:35:00\n结束时间: 9/24/2023, 16:35:00\nhttps://codeforces.com/contests/1879\n\n比赛平台: Codeforces\n比赛名称: Codeforces Round 899 (Div. 2)\n赛制: Codeforces\n开始时间: 9/25/2023, 14:35:00\n结束时间: 9/25/2023, 16:35:00\nhttps://codeforces.com/contests/1882\n\n比赛平台: Codeforces\n比赛名称: Codeforces Round 900 (Div. 3)\n赛制: ICPC\n开始时间: 9/26/2023, 14:35:00\n结束时间: 9/26/2023, 16:50:00\nhttps://codeforces.com/contests/1878\n\n比赛平台: AtCoder\n比赛名称: Ⓐ AtCoder Beginner Contest 322\n赛制: AtCoder\n开始时间: 9/30/2023, 12:00:00\n结束时间: 9/30/2023, 13:40:00\nhttps://atcoder.jp/contests/abc322\n\n比赛平台: Codeforces\n比赛名称: Codeforces Round 901 (Div. 1)\n赛制: Codeforces\n开始时间: 9/30/2023, 14:35:00\n结束时间: 9/30/2023, 17:35:00\nhttps://codeforces.com/contests/1874\n\n比赛平台: Codeforces\n比赛名称: Codeforces Round 901 (Div. 2)\n赛制: Codeforces\n开始时间: 9/30/2023, 14:35:00\n结束时间: 9/30/2023, 17:35:00\nhttps://codeforces.com/contests/1875\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e \u003ccode\u003e\u003e lsct -o at cf -d -1 -r --no-sort\u003c/code\u003e \u003c/summary\u003e\n\n```json\n{\n  \"running\": [\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓗ  Marubeni Programming Contest 2023 (AtCoder Heuristic Contest 024)\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-09-24T06:00:00.000Z\",\n      \"endTime\": \"2023-09-24T10:00:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/ahc024\"\n    }\n  ],\n  \"upcoming\": [\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓐ AtCoder Beginner Contest 322\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-09-30T12:00:00.000Z\",\n      \"endTime\": \"2023-09-30T13:40:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/abc322\"\n    },\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓐ UNIQUE VISION Programming Contest 2023 Autumn(AtCoder Beginner Contest 323)\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-10-07T12:00:00.000Z\",\n      \"endTime\": \"2023-10-07T13:40:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/abc323\"\n    },\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓐ AtCoder Regular Contest 166\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-10-08T12:00:00.000Z\",\n      \"endTime\": \"2023-10-08T14:00:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/arc166\"\n    },\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓗ AtCoder Heuristic Contest 025\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-10-14T03:00:00.000Z\",\n      \"endTime\": \"2023-10-22T10:00:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/ahc025\"\n    },\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓐ Japan Registry Services (JPRS) Programming Contest 2023 (AtCoder Beginner Contest 324)\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-10-14T12:00:00.000Z\",\n      \"endTime\": \"2023-10-14T13:40:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/abc324\"\n    },\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓐ AtCoder Regular Contest 167\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-10-15T12:00:00.000Z\",\n      \"endTime\": \"2023-10-15T14:00:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/arc167\"\n    },\n    {\n      \"ojName\": \"AtCoder\",\n      \"name\": \"Ⓐ Panasonic Programming Contest 2023（AtCoder Beginner Contest 326）\",\n      \"rule\": \"AtCoder\",\n      \"startTime\": \"2023-10-28T12:00:00.000Z\",\n      \"endTime\": \"2023-10-28T13:40:00.000Z\",\n      \"url\": \"https://atcoder.jp/contests/abc326\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Educational Codeforces Round 155 (Rated for Div. 2)\",\n      \"rule\": \"ICPC\",\n      \"startTime\": \"2023-09-24T14:35:00.000Z\",\n      \"endTime\": \"2023-09-24T16:35:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1879\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round 899 (Div. 2)\",\n      \"rule\": \"Codeforces\",\n      \"startTime\": \"2023-09-25T14:35:00.000Z\",\n      \"endTime\": \"2023-09-25T16:35:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1882\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round 900 (Div. 3)\",\n      \"rule\": \"ICPC\",\n      \"startTime\": \"2023-09-26T14:35:00.000Z\",\n      \"endTime\": \"2023-09-26T16:50:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1878\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round 901 (Div. 1)\",\n      \"rule\": \"Codeforces\",\n      \"startTime\": \"2023-09-30T14:35:00.000Z\",\n      \"endTime\": \"2023-09-30T17:35:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1874\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round 901 (Div. 2)\",\n      \"rule\": \"Codeforces\",\n      \"startTime\": \"2023-09-30T14:35:00.000Z\",\n      \"endTime\": \"2023-09-30T17:35:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1875\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round (Div. 1)\",\n      \"rule\": \"Codeforces\",\n      \"startTime\": \"2023-10-08T09:05:00.000Z\",\n      \"endTime\": \"2023-10-08T11:35:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1876\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round (Div. 2)\",\n      \"rule\": \"Codeforces\",\n      \"startTime\": \"2023-10-08T09:05:00.000Z\",\n      \"endTime\": \"2023-10-08T11:35:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1877\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round (Div. 3)\",\n      \"rule\": \"ICPC\",\n      \"startTime\": \"2023-10-12T14:35:00.000Z\",\n      \"endTime\": \"2023-10-12T16:50:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1881\"\n    },\n    {\n      \"ojName\": \"Codeforces\",\n      \"name\": \"Codeforces Round (Div. 3)\",\n      \"rule\": \"ICPC\",\n      \"startTime\": \"2023-10-22T12:05:00.000Z\",\n      \"endTime\": \"2023-10-22T14:20:00.000Z\",\n      \"url\": \"https://codeforces.com/contests/1883\"\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\u003c!-- block_cli end --\u003e\n\n### API\n\n更详细的 API 文档请访问 \u003chttps://lsct.stagoh.com\u003e。\n\n如果你想要在你的项目中调用 *lscontests* 来获取比赛信息，或者你想要添加对其他 OJ 的支持，那么你可以像下面这样来调用 *lscontests*：\n\n#### 获取比赛文本信息\n\n```typescript\nimport lsct from \"lscontests\";\n\nnew lsct({ abbrList: [\"cf\", \"lg\"] }).getContestsText().then(console.log);\n```\n\n这段代码的运行结果与 `lsct -o cf lg` 相同。\n\n#### 获取比赛列表\n\n```typescript\nimport lsct from \"lscontests\";\n\nnew lsct({ abbrList: [\"cf\", \"lg\"] }).getContests().then(console.log);\n```\n\n这段代码的运行结果与 `lsct -r --no-sort` 相同。\n\n#### 添加对其他 OJ 的支持\n\n```typescript\nimport lsct, { addOJ } from \"lscontests\";\n\naddOJ(\"ts\", {\n    name: \"testOJ\", get: async () =\u003e [{\n        ojName: \"testOJ\",\n        name: \"testContest\",\n        rule: \"ICPC\",\n        startTime: new Date(Date.now() - 1),\n        endTime: new Date(Date.now() + 3600000),\n        url: \"https://www.test.com\"\n    }]\n});\n\nasync function main() {\n    console.log(await new lsct({ abbrList: [\"cf\", \"ts\"], days: 1 }).getContestsText());\n    console.log();\n    console.log(await new lsct({ abbrList: [\"at\", \"ts\"], days: 7 }).getContests());\n}\n\nmain();\n```\n\n这段代码的运行结果如下：\n\n```text\n在 testOJ 上有 1 场正在进行的比赛\n\n比赛平台: testOJ\n比赛名称: testContest\n赛制: ICPC\n开始时间: 2022/6/10 21:46:00\n结束时间: 2022/6/10 22:46:00\nhttps://www.test.com\n\n接下来的 1 天内在 Codeforces 上有 1 场比赛\n\n比赛平台: Codeforces\n比赛名称: Codeforces Round #798 (Div. 2)\n赛制: Codeforces\n开始时间: 2022/6/11 00:35:00\n结束时间: 2022/6/11 02:35:00\nhttps://codeforces.com/contests/1689\n\n{\n  running: [\n    {\n      ojName: 'testOJ',\n      name: 'testContest',\n      rule: 'ICPC',\n      startTime: 2022-06-10T13:46:03.113Z,\n      endTime: 2022-06-10T14:46:03.114Z,\n      url: 'https://www.test.com'\n    }\n  ],\n  upcoming: [\n    {\n      ojName: 'AtCoder',\n      name: 'Ⓐ Aising Programming Contest 2022（AtCoder Beginner Contest 255）',\n      rule: 'AtCoder',\n      startTime: 2022-06-11T12:00:00.000Z,\n      endTime: 2022-06-11T13:40:00.000Z,\n      url: 'https://atcoder.jp/contests/abc255'\n    }\n  ]\n}\n```\n\n#### 像使用 CLI 一样\n\n```typescript\nimport { cli } from \"lscontests\";\n\ncli(\"-o cf -L en\", undefined, console.log);\n```\n\n这段代码的运行结果与 `lsct -o cf -L en` 相同。\n\n## 许可证\n\n[GPL-3.0](https://www.gnu.org/licenses/gpl-3.0.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstableagoh%2Flscontests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstableagoh%2Flscontests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstableagoh%2Flscontests/lists"}