Skip to content

Commit

Permalink
Update scraped course data with new CRN link (#209)
Browse files Browse the repository at this point in the history
* Change url for course and term in scrapers

* Add new URL to section parser

* Update snapshot tests
  • Loading branch information
Lucas-Dunker authored Nov 27, 2023
1 parent cdce629 commit cd9536f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
7 changes: 3 additions & 4 deletions scrapers/classes/parsersxe/classParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,19 @@ class ClassParser {
nupath: this.nupath(attributes),
desc: he.decode(description),
prettyUrl:
"https://wl11gp.neu.edu/udcprod8/bwckctlg.p_disp_course_detail?" +
"https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?" +
`cat_term_in=${termId}&subj_code_in=${subjectCode}&crse_numb_in=${courseNumber}`,
name: he.decode(SR.courseTitle),
url:
"https://wl11gp.neu.edu/udcprod8/bwckctlg.p_disp_listcrse?" +
`term_in=${termId}&subj_in=${subjectCode}&crse_in=${courseNumber}&schd_in=%`,
"https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?" +
`cat_term_in=${termId}&subj_code_in=${subjectCode}&crse_numb_in=${courseNumber}`,
lastUpdateTime: Date.now(),
maxCredits: SR.creditHourHigh || SR.creditHourLow,
minCredits: SR.creditHourLow,
college: collegeNames[termId.charAt(termId.length - 1)],
feeAmount,
feeDescription,
};

if (prereqs) {
classDetails.prereqs = prereqs;
}
Expand Down
4 changes: 2 additions & 2 deletions scrapers/classes/parsersxe/sectionParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class SectionParser {
return a.description === "Honors";
}),
url:
"https://wl11gp.neu.edu/udcprod8/bwckschd.p_disp_detail_sched" +
`?term_in=${SR.term}&crn_in=${SR.courseReferenceNumber}`,
"https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?" +
`cat_term_in=${SR.term}&subj_code_in=${SR.subject}&crse_numb_in=${SR.courseNumber}`,
profs: SR.faculty.map(MeetingParser.profName),
meetings: MeetingParser.parseMeetings(SR.meetingsFaculty),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ Object {
},
],
},
"prettyUrl": "https://wl11gp.neu.edu/udcprod8/bwckctlg.p_disp_course_detail?cat_term_in=202010&subj_code_in=CHEM&crse_numb_in=2311",
"prettyUrl": "https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?cat_term_in=202010&subj_code_in=CHEM&crse_numb_in=2311",
"subject": "CHEM",
"termId": "202010",
"url": "https://wl11gp.neu.edu/udcprod8/bwckctlg.p_disp_listcrse?term_in=202010&subj_in=CHEM&crse_in=2311&schd_in=%",
"url": "https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?cat_term_in=202010&subj_code_in=CHEM&crse_numb_in=2311",
}
`;

Expand Down Expand Up @@ -77,9 +77,9 @@ Object {
},
],
},
"prettyUrl": "https://wl11gp.neu.edu/udcprod8/bwckctlg.p_disp_course_detail?cat_term_in=202010&subj_code_in=CS&crse_numb_in=2500",
"prettyUrl": "https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?cat_term_in=202010&subj_code_in=CS&crse_numb_in=2500",
"subject": "CS",
"termId": "202010",
"url": "https://wl11gp.neu.edu/udcprod8/bwckctlg.p_disp_listcrse?term_in=202010&subj_in=CS&crse_in=2500&schd_in=%",
"url": "https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?cat_term_in=202010&subj_code_in=CS&crse_numb_in=2500",
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Object {
"seatsRemaining": 36,
"subject": "CHEM",
"termId": "202010",
"url": "https://wl11gp.neu.edu/udcprod8/bwckschd.p_disp_detail_sched?term_in=202010&crn_in=10259",
"url": "https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?cat_term_in=202010&subj_code_in=CHEM&crse_numb_in=2311",
"waitCapacity": 0,
"waitRemaining": 0,
}
Expand Down Expand Up @@ -101,8 +101,8 @@ Object {
"seatsRemaining": 4,
"subject": "CS",
"termId": "201930",
"url": "https://wl11gp.neu.edu/udcprod8/bwckschd.p_disp_detail_sched?term_in=201930&crn_in=30340",
"url": "https://bnrordsp.neu.edu/ssb-prod/bwckctlg.p_disp_course_detail?cat_term_in=201930&subj_code_in=CS&crse_numb_in=2500",
"waitCapacity": 0,
"waitRemaining": 0,
}
`;
`;
2 changes: 1 addition & 1 deletion scrapers/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const separateReqPools: Record<string, RequestPool> = {
// Took 1hr and 15 min with 500 sockets and RETRY_DELAY set to 20000 and delta set to 15000.
// Usually takes just under 1 hr at 1k sockets and the same timeouts.
// Took around 20 min with timeouts set to 100ms and 150ms and 100 sockets.
"wl11gp.neu.edu": {
"https://bnrordsp.neu.edu": {
options: { maxSockets: 100, keepAlive: true, maxFreeSockets: 100 },
agents: false,
},
Expand Down

0 comments on commit cd9536f

Please sign in to comment.