-f to -F
[tpope-extra.git] / perl / sctweb
index 9aef892403e2d7d2290ea829cff15516970944a9..4b1c0b1e7ae1aeae33b0290117d3cf9632099d1c 100755 (executable)
@@ -61,7 +61,7 @@ sub US_Labor # First Monday after the first Sunday in September
 }
 
 my $config = $ENV{HOME} . "/.sctwebrc";
-if ($ARGV[0] eq '-f') {
+if ($ARGV[0] eq '-F') {
     shift;
     $config = shift;
 }
@@ -181,6 +181,8 @@ sub off_for_exams {
        } elsif($time =~ /$ending/) {
            return $lastday-5;
        }
+    } elsif($days eq "5") {
+       return $lastday-2;
     }
     return wantarray ? () : "";
 }
@@ -230,7 +232,7 @@ sub get_schedule_terms {
     } elsif ($localtime[4]<10) { # through Oct 31
        @sterms=((1900+$localtime[5]).$a[0]);
     } else {
-       @sterms=((1900+$localtime[5])."1",(1901+$localtime[5])."2");
+       @sterms=((1900+$localtime[5]).$a[0],(1901+$localtime[5]).$a[1]);
     }
     return @sterms;
 }
@@ -312,7 +314,7 @@ sub get_schedule {
            $row->[2] =~ s/(.*\S)\s*//;
            $session = $1;
            $row->[2] =~ s/(\d\d)-(\d\d)-(\d\d)/20$3$1$2/g;
-           $row->[2] =~ s/ *to */-/g;
+           $row->[2] =~ s/ *to */\n/g;
            $row->[3] = capitalize($row->[3]);
            $row->[3] =~ s/([A-Z]r?)$/$1./;
            push @schedule, {
@@ -615,7 +617,8 @@ sub do_transcripts {
     $response = $ua->get("$url&tserve_tip_write=||WID|SID|PIN&tserve_trans_config=rtranscr.cfg&CareerReqNum=1");
     foreach (split /\n/, $response->content) {
        next unless s/^\&nbsp;|<pre>// || s/\&nbsp;/ /;
-       s/<\/?[Hh]\d>//g;
+       s/<\/?([Hh]\d|[Bb])>//g;
+       next if /<\/td>/;
        print "$_\n";
     }
 }