auto-loading completely done

This commit is contained in:
Sriram Hariharan
2023-03-05 14:34:26 -06:00
parent 2b952d0591
commit 0956525e94
13 changed files with 248 additions and 53 deletions

View File

@@ -1,4 +1,4 @@
import { Course, Instructor, Status, InstructionMode, CourseRow } from 'src/shared/types/Course';
import { Course, Instructor, Status, InstructionMode, ScrapedRow } from 'src/shared/types/Course';
import { CourseSchedule, CourseMeeting } from 'src/shared/types/CourseSchedule';
import { SiteSupport } from 'src/views/lib/getSiteSupport';
@@ -27,7 +27,7 @@ enum DetailsSelector {
}
/**
* A class that allows use to scrape information from UT's course catalog to create our internal representation of a course
* A class that allows us to scrape information from UT's course catalog to create our internal representation of a course
*/
export class CourseCatalogScraper {
support: SiteSupport;
@@ -41,8 +41,8 @@ export class CourseCatalogScraper {
* @param rows the rows of the course catalog table
* @returns an array of course row objects (which contain courses corresponding to the htmltable row)
*/
public scrape(rows: NodeListOf<HTMLTableRowElement>): CourseRow[] {
const courses: CourseRow[] = [];
public scrape(rows: NodeListOf<HTMLTableRowElement> | HTMLTableRowElement[]): ScrapedRow[] {
const courses: ScrapedRow[] = [];
let fullName = this.getFullName();
@@ -94,7 +94,7 @@ export class CourseCatalogScraper {
},
});
courses.push({
rowElement: row,
element: row,
course: newCourse,
});
});