# HG changeset patch # User Nathan Phillip Brink # Date 2012-02-15 13:07:20 # Node ID bc24a9e141ffaf26dd2a477140268b735500878b # Parent 877c1fbf1cd00b22ce1699011d0a55205005f684 Add ability to distinguish, in most cases, between labs and lectures at Hope. Hope's scheduling paradigm requires the use of course slots, so distinguishing between labs and normal sections is vital. diff --git a/school.d/hope.crawl.inc b/school.d/hope.crawl.inc --- a/school.d/hope.crawl.inc +++ b/school.d/hope.crawl.inc @@ -301,11 +301,12 @@ function hope_crawl_semester(array $scho } /* - * Guessing the type of section_meeting: `attribute' of NSL seems to - * be associated with labs. + * Guessing the type of section_meeting: `attribute' of NSL + * seems to be associated with labs. Matches `lab', `lab.', ` + * lab', ` labo'..., etc. */ $type = 'lecture'; - if ($section_csv[$fields['Attr']] == 'NSL') + if (preg_match('/(^|[^a-z])lab($|o|[^a-z])/i', $title)) $type = 'lab'; $section_meeting = new SectionMeeting($days, $time_start, $time_end, @@ -318,7 +319,7 @@ function hope_crawl_semester(array $scho $section_id, $synonym, $section_meeting, - 'default', + $type, $section_csv[$fields['Cred']]); } return 0;