pittcsc / PittAPI

An API to easily get data from the University of Pittsburgh
https://pittapi.pittcsc.org
GNU General Public License v2.0
105 stars 30 forks source link

Updated laundry module parsing for new link #142

Closed nij-patel closed 4 months ago

nij-patel commented 4 months ago

LaundryView updated their links, so the link that was previously being scraped for data no longer leads to the graphic. Instead, there is a new link to get that data, and the old link that the code had as itsBASE_URL now just leads to a JSON payload of all the info about the different washers and dryers.

I updated the parsing strategy so instead of web scarping with BeautifulSoup, it just takes the JSON from the old link, parses the necessary information, and returns it in the way the code originally did. The old link essentially works like a LaundryView API now.

I also added a mock JSON file for testing purposes, and refactored the test to accommodate for that.