Skip to content

Instantly share code, notes, and snippets.

@KartikTalwar
Created November 14, 2013 19:01
Show Gist options
  • Save KartikTalwar/7472416 to your computer and use it in GitHub Desktop.
Save KartikTalwar/7472416 to your computer and use it in GitHub Desktop.
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