docs: how to parse Comcigan

This commit is contained in:
Starcea 2024-07-14 22:45:56 +09:00
commit 348189ef62
No known key found for this signature in database
GPG key ID: B7A77E32374911E1
2 changed files with 109 additions and 8 deletions

View file

@ -5,6 +5,8 @@
[컴시간알리미](http://컴시간학생.kr)를 파싱하는 TypeScript 라이브러리입니다.
컴시간알리미의 구조 및 파싱 방법은 [docs/README.md](./docs/README.md)를 참고해주세요.
## 설치
```bash
@ -16,17 +18,17 @@ pnpm add comcigan.ts # pnpm
## 사용 예시
```typescript
import Comcigan, { School, Weekday } from 'comcigan.ts'
import Comcigan, { School, Weekday } from "comcigan.ts";
const comcigan = new Comcigan()
const comcigan = new Comcigan();
const main = async () => {
const searchedSchools = await comcigan.searchSchools('학교 이름') // 학교 검색
const school = await School.fromName('학교 이름') // 바로 불러오기 (== searchedSchools[0])
const searchedSchools = await comcigan.searchSchools("학교 이름"); // 학교 검색
const school = await School.fromName("학교 이름"); // 바로 불러오기 (== searchedSchools[0])
console.log(await school.getTimetable(3, 3, Weekday.Friday)) // 3학년 3반 금요일 시간표
console.log(await comcigan.getTimetable(school.code, 3, 3, Weekday.Friday)) // 학교 코드를 이용하는 방법
}
console.log(await school.getTimetable(3, 3, Weekday.Friday)); // 3학년 3반 금요일 시간표
console.log(await comcigan.getTimetable(school.code, 3, 3, Weekday.Friday)); // 학교 코드를 이용하는 방법
};
main()
main();
```