Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
That's my spot!
<?php
$sub = 'CS';
$num = '115';
$term = '1141';
$key = '';
$g = json_decode(file_get_contents('https://api.uwaterloo.ca/v2/courses/'.$sub.'/'.$num.'/schedule.json?key='.$key.'&term='.$term));
foreach($g->data as $i)
{
if(strpos($i->section, 'LEC') === 0) {
if($i->enrollment_total < $i->enrollment_capacity) {
echo 'Spot Open! '.$i->section;
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment