X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=blobdiff_plain;f=perl%2Fsctweb;h=7c6f23ea7280b08f616feed7c024eb97cb103072;hp=e0c8d2896ec4a914b5619dd885ed855dae27649a;hb=bc83d0e12d5f3a428a34c90b6acbbd072c7606c5;hpb=97637b60906041e3540506cc54e287089287777a diff --git a/perl/sctweb b/perl/sctweb index e0c8d28..7c6f23e 100755 --- a/perl/sctweb +++ b/perl/sctweb @@ -40,7 +40,7 @@ sub capitalize { s/\b([A-Z])([A-Z]*)\b/$1\L$2/g; s/\b(I)(i*)\b/$1\U$2/g; s/\bUs\b/US/g; - s/ (Of|For|The|To|And|Or) / \l$1 /g; + s/ (And|For|Of|Or|The|To|With) / \l$1 /g; s/\b(Ma?c)([a-z])/$1\u$2/g; s/\b(Tcp\/Ip|Pc)\b/\U$&/g; s/\bThru\b/Through/g; @@ -75,7 +75,7 @@ sub get_schedule_terms { } sub do_mhc_schedule { - my @readheaders = ("Section ID/Title", "Days", "Time", "Start/EndDates"); + my @readheaders = ("Section ID/Title", "Days", "Time", "Start/EndDates", "Site/Building/Room"); my %days = (M => "Mon", T => "Tue", W => "Wed", R => "Thu", F => "Fri", S => "Sat"); my $te = new HTML::TableExtract( headers => [ @readheaders ] ); my (@terms, $row); @@ -101,12 +101,15 @@ sub do_mhc_schedule { $row->[2] =~ s/PM$//; } else { $row->[2] =~ s/AM$//; } $row->[3] =~ s/(\d\d)-(\d\d)-(\d\d)/20$3$1$2/g; + $row->[4] =~ s/ON CAMPUS-//g; + $row->[4] =~ s/-/ /g; print "\n"; print "X-SC-Subject: ", $row->[0], "\n"; print "X-SC-Category: School\n"; print "X-SC-Cond:", $row->[1], "\n"; # Space after colon not needed print "X-SC-Time: ", $row->[2], "\n"; print "X-SC-Duration: ", $row->[3], "\n"; + print "X-SC-Location: ", $row->[4], "\n"; } } }