Crates.io | ubs |
lib.rs | ubs |
version | 0.1.1 |
source | src |
created_at | 2022-12-01 04:55:28.435774 |
updated_at | 2023-08-05 21:22:53.043423 |
description | a CLI for fetching real-time University at Buffalo class schedules |
homepage | |
repository | https://github.com/ok-nick/ubs |
max_upload_size | |
id | 727323 |
size | 53,333 |
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::Cse115,
Semester::Spring2023,
).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(())
}
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.
No, this library operates exclusively on public information that is readily accessible to anyone. There are no proprietary or confidential data sources involved.