https://github.com/perongh/ebridge-timetable
XJTLU e-Bridge timetable parser that can generate .ics file from HTML page
https://github.com/perongh/ebridge-timetable
deno typescript xjtlu
Last synced: 6 months ago
JSON representation
XJTLU e-Bridge timetable parser that can generate .ics file from HTML page
- Host: GitHub
- URL: https://github.com/perongh/ebridge-timetable
- Owner: PeronGH
- Created: 2022-09-07T10:34:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-20T05:27:41.000Z (about 2 years ago)
- Last Synced: 2024-11-17T14:12:40.382Z (6 months ago)
- Topics: deno, typescript, xjtlu
- Language: TypeScript
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# e-Bridge Timetable to .ics file
### Basic Usage
1. Install deno
2. Download source code
3. Prepare the .html file of e-bridge timetable and rename it to `XJTLU e-Bridge.html`
4. `deno test -A tests.ts`
5. Check `test.ics` in the folderor
1. Install deno
2. Download the source code
3. `deno run -A cli.ts`Tip: `control + C` to force quit cli
### Advanced Usage
```typescript
import { DOMParser, genCalendar, parseTimetable } from "https://deno.land/x/[email protected]/mod.ts";const document = new DOMParser().parseFromString(
Deno.readTextFileSync('XJTLU e-Bridge.html').toString(),
'text/html'
)!;const lessons = parseTimetable(document);
console.table(lessons);
const calendar = genCalendar(lessons);
console.log(calendar.toLines());
Deno.writeTextFileSync('test.ics', calendar.toString());
```