ubs
is a library designed to provide real-time access to University at Buffalo class schedules, offering a wealth of information on each class. This includes: class open/closed
, start/end date
, start/end time
, class type
, class id
, section
, room
, instructor
, seats open/closed
, etc.
$ cargo install ubs
Below is a snippet of using the high-level API with tokio for fetching live class information.
use futures::stream::TryStreamExt;
use ubs_lib::{Career, Course, Semester};
#[tokio::main]
async fn main() -> Result<(), ubs_lib::Error> {
let mut schedule_iter = ubs_lib::schedule_iter(
Course::Cse115Llr,
Semester::Spring2024,
).await?;
while let Some(schedule) = schedule_iter.try_next().await? {
for group in schedule?.group_iter()? {
for class in group.class_iter() {
// do stuff
}
}
}
Ok(())
}
A Discord bot for querying and listening to changes in class schedules. Supports caching!
The process involves sending a precisely tailored sequence of network requests directed towards the target URL. Upon receiving the requests, the resulting HTML is cached until the user requests specific information, at which point it is parsed to specification and the inner values are extracted using Regex.
Yes. While direct access to the core library may not be possible from other languages (yet), the library does provide a command-line interface that can output data in the desired format.
Sort of stable. While using this library, it's important to note that there is a possibility that the underlying API may change in the future. Therefore, it may not be advisable to depend on this library for critical code. However, the library does have a comprehensive continuous integration system that runs daily, catching potential issues early on. In the event that the API does change and ubs
ceases to function properly, users are encouraged to report the issue so that it can be resolved.
Existing methods of fetching University at Buffalo class schedules operate nightly (if they even still exist). In contrast, ubs
operates in real-time, fetching the latest and most up to date information.
No, this library operates exclusively on public information that is readily accessible to anyone. There are no proprietary or confidential data sources involved.