You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From looking at the webpage, it appears that the data is made available via the following URL: https://sa.ucla.edu/ro/Public/SOC/Search/SearchByFoundation. When making a request for all "Foundations of Arts and Humanities" GEs, I noticed my browser made a request to https://sa.ucla.edu/ro/Public/SOC/Search/SearchByFoundation with the following parameters:
input: {"FoundationCode":"AH","CategoryCode":"%","LabDemoFilter":false,"WritingTwoFilter":false,"MultiCategoryFilter":false,"DiversityFilter":false}
search_criteria: Foundations of Arts and Humanities
Both input and search_criteria seem to be required. We'll need to enumerate all the possible FoundationCodes and search_criteria in order to scrape for all GE categories.
The Response
GE info is returned as HTML, with the courses grouped by subject area. There is one <table> per subject area. Standard HTML parsing should work well here.
Storage
We store information about a course in the courses table. A course can fulfill multiple GE categories and each GE category has multiple courses that can satisfy the requirement. So we're looking at a many to many relationship. We should create a new migration that:
Creates a new table: ge_categories is a good potential name. Each row on the table should be a sub-category GE requirement. (ex: "Literary and Cultural Analysis")
Sets up a many-to-many relationship between courses and ge_categories
We'll likely want to create a new method on the Course model that gives all the GE categories that a course satisfies. Then we can surface this via the controller/erb templates.
The text was updated successfully, but these errors were encountered:
Hotseat currently has no information about what classes are GEs, what requirements they fulfill, etc.
GE requirements vary by school, but they're grouped into three foundational areas, each with 2-3 subarea:
There are three main parts of this issue:
Scraping
The Request
The information on which classes satisfy which requirements is available from the UCLA Registrar: https://sa.ucla.edu/ro/Public/SOC/Search/GECoursesMasterList
From looking at the webpage, it appears that the data is made available via the following URL:
https://sa.ucla.edu/ro/Public/SOC/Search/SearchByFoundation
. When making a request for all "Foundations of Arts and Humanities" GEs, I noticed my browser made a request tohttps://sa.ucla.edu/ro/Public/SOC/Search/SearchByFoundation
with the following parameters:Both
input
andsearch_criteria
seem to be required. We'll need to enumerate all the possibleFoundationCode
s andsearch_criteria
in order to scrape for all GE categories.The Response
GE info is returned as HTML, with the courses grouped by subject area. There is one
<table>
per subject area. Standard HTML parsing should work well here.Storage
We store information about a course in the
courses
table. A course can fulfill multiple GE categories and each GE category has multiple courses that can satisfy the requirement. So we're looking at a many to many relationship. We should create a new migration that:ge_categories
is a good potential name. Each row on the table should be a sub-category GE requirement. (ex: "Literary and Cultural Analysis")courses
andge_categories
We should then update the models to use
has_and_belongs_to_many
for this new relationship.Frontend
We'll likely want to create a new method on the
Course
model that gives all the GE categories that a course satisfies. Then we can surface this via the controller/erb templates.The text was updated successfully, but these errors were encountered: