MCPcopy Index your code
hub / github.com/Tatamo/atcoder-cli / contest

Method contest

src/atcoder.ts:127–136  ·  view source on GitHub ↗

* コンテストIDからコンテストの情報を取得 * @param id * @throws Error

(id: string)

Source from the content-addressed store, hash-verified

125 * @throws Error
126 */
127 async contest(id: string): Promise<Contest> {
128 const url = AtCoder.getContestURL(id);
129 // コンテストが見つからない場合エラーとなるがハンドルせず外に投げる
130 const response = await this.session.get(url);
131 const {JSDOM} = await import("jsdom");
132 const {document} = new JSDOM(response.data).window;
133 const regexp = /^(.*) - AtCoder$/;
134 const title = regexp.test(document.title) ? regexp.exec(document.title)![1] : document.title;
135 return {id, title, url};
136 }
137
138 /**
139 * 問題一覧を取得

Callers 5

contestFunction · 0.80
urlFunction · 0.80
formatFunction · 0.80
initFunction · 0.80
atcoder.tsFile · 0.80

Calls 2

getContestURLMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected