wip scraping infra

This commit is contained in:
Sriram Hariharan
2023-03-04 11:51:56 -06:00
parent 2d940493a3
commit c9684beb5b
6 changed files with 231 additions and 32 deletions

View File

@@ -1,29 +1,45 @@
import { Serialized } from 'chrome-extension-toolkit';
import { CourseSchedule } from './CourseSchedule';
type CourseSchedule = {};
type Professor = {
/**
* A professor's name, first name, and initial (if applicable)
* Also includes a link to their RateMyProfessor page
*/
export type Instructor = {
name: string;
firstName?: string;
initial?: string;
lastName?: string;
middleInitial?: string;
rateMyProfessorURL?: string;
};
type InstructionMode = 'Online' | 'In Person' | 'Hybrid';
/**
* Whether the class is taught online, in person, or a hybrid of the two
*/
export type InstructionMode = 'Online' | 'In Person' | 'Hybrid';
type Links = {
export type Links = {
syllabi?: string;
textbook?: string;
rateMyProfessor?: string;
eCIS?: string;
};
export enum Status {
OPEN = 'OPEN',
CLOSED = 'CLOSED',
WAITLISTED = 'WAITLISTED',
CANCELLED = 'CANCELLED',
}
export class Course {
uniqueId: number;
number: string;
name: string;
department: string;
professor: Professor;
description?: string;
status: Status;
instructors: Instructor[];
isReserved: boolean;
description: string[];
schedule: CourseSchedule;
currentStatus: string;
url: string;
@@ -36,3 +52,8 @@ export class Course {
Object.assign(this, course);
}
}
export type CourseRow = {
rowElement: HTMLTableRowElement;
course: Course;
};

View File

@@ -0,0 +1,29 @@
import { Serialized } from 'chrome-extension-toolkit';
type Day = 'M' | 'T' | 'W' | 'TH' | 'F' | 'S' | 'SU';
type Room = {
building: string;
number: string;
};
type CourseSection = {
day: Day;
startTime: number;
endTime: number;
room?: Room;
};
export class CourseSchedule {
sections: CourseSection[];
constructor(courseSchedule: CourseSchedule | Serialized<CourseSchedule>) {
Object.assign(this, courseSchedule);
}
static parse(days: Day[] , times, hours): CourseSchedule {}
toString(): string {
return '';
}
}