-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: added faculty to the courseInfo scraped (#152)
* feature: added faculty to the courseInfo scraped * fix: updated api endpoint to send faculty data and fixed scraper logic for extracting faculty data * fix: updated chunk-scraper to send faculty data * fix imports to be sorted in alphabetical order --------- Co-authored-by: Chanel <[email protected]> Co-authored-by: Shaam <[email protected]>
- Loading branch information
1 parent
99a6bb4
commit c31be22
Showing
5 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
scraper/src/page-scraper/chunk-scraper/chunk-helpers/GetFaculty.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Extracts the name of the faculty that offers the course that is being parsed | ||
* @param faculty: Line that contains data about the faculty field | ||
* @returns { string }: The faculty that offers the current course | ||
*/ | ||
const getFaculty = (faculty: string): string => { | ||
// Faculty is a string | ||
if (!faculty || faculty === " ") { | ||
console.error(new Error(`Invalid Faculty: ${faculty}`)); | ||
} | ||
|
||
return faculty; | ||
}; | ||
|
||
export { getFaculty }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters