Pages
HomeRecent Projects
I started this mini-project out of the ever-so-fruitful combination of boredom and curiosity. I had been interested in developing a browser extension for a while, but I didn’t have any ideas to kickstart the learning process. But alas, the idea for KU | RateMyProfessors browser extension came to me!
A while back, a friend of mine showed me a similar idea that had been implemented for his school’s course search page. I guess it stewed around in my head for a while and bubbled up in the midst of the COVID-19 pandemic.
This project is completely open source and fairly simple. Have a look around, and make some changes if you want!
As of writing this, the core script is scrapeProfessors()
which can be found in ku-rmp.js
.
It uses a simple query selector to find all instances of professors on the page and grabs their innerHTML
property.
Then, it appends their name onto a RateMyProfessors.com search query that filters school to the University of Kansas:
https://www.ratemyprofessors.com/search.jsp?queryoption=HEADER&queryBy=teacherName&schoolName=University+of+Kansas&schoolID=1117&query=
This certainly isn’t the best way to go about this, but I want to stay legal. I extracted the endpoint necessary to get JSON
formatted data about each professor, but I decided against implementing it. It seems like this would lie in a legal gray area and I don’t want to put the effort in just to get a cease and desist letter as a reward.
If you are curious, the following endpoint will return information on a professor at the University of Kansas by substituting {PROFNAME}
for any query:
https://solr-aws-elb-production.ratemyprofessors.com//solr/rmp/select/?solrformat=true&rows=5&wt=json&q={PROFNAME}&rows=5&fq=schoolname_t:%22University%20of%20Kansas%22&fq=schoolid_s:1117
&q=Jeff Lang
Returns:
{
"responseHeader":{
"status":0,
"QTime":5,
"params":{
"solrformat":"true",
"rows":[
"5",
"5"
],
"wt":"json",
"q":"Jeff Lang",
"fq":[
"schoolname_t:\"University of Kansas\"",
"schoolid_s:1117"
]
}
},
"response":{
"numFound":1,
"start":0,
"docs":[
{
"city_state_s":"Lawrence_KS",
"averageratingscore_rf":4.7,
"pk_id":1244467,
"schoolcity_s":"Lawrence",
"schoolstate_full_s":"Kansas",
"id":"teacher:1244467",
"pageviews_i":88,
"averagehelpfulscore_rf":4.6,
"schoolcountry_s":"United States",
"schoolname_s":"University of Kansas",
"status_i":1,
"averagehotscore_rf":0.0,
"schoolstate_s":"KS",
"rated_date_dt":"2020-05-14T00:00:00Z",
"teacherfullname_s":"Jeffrey Lang",
"teacherdepartment_s":"Mathematics",
"total_number_of_ratings_i":157,
"visible_i":1,
"content_type_s":"TEACHER",
"averageeasyscore_rf":1.6,
"schoolid_s":"1117",
"teacherfirstname_t":"Jeffrey",
"teacherlastname_t":"Lang",
"averageclarityscore_rf":4.7,
"schoolwebpage_s":"http://www.ku.edu",
"timestamp":"2020-07-27T18:07:20.685Z",
"tag_s_mv":[
"Tough Grader",
"Skip class? You won't pass.",
"Gives Extra Credit",
"Amazing lectures",
"Clear grading criteria",
"Would take again",
"Gives good feedback",
"Inspirational",
"Hilarious",
"There for you",
"Respected by students"
],
"tag_id_s_mv":[
"1",
"4",
"5",
"8",
"9",
"11",
"12",
"13",
"15",
"18",
"19"
]
}
]
},
"spellcheck":{
"suggestions":[
"Jeff",
{
"numFound":1,
"startOffset":0,
"endOffset":4,
"suggestion":[
" Neff"
]
},
"Lang",
{
"numFound":1,
"startOffset":5,
"endOffset":9,
"suggestion":[
" Lang"
]
}
]
}
}