X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=blobdiff_plain;f=perl%2Fsctweb;h=1ca3d7c4fa6044246989c58d09c0d131d8b57db9;hp=9aef892403e2d7d2290ea829cff15516970944a9;hb=57c2826cf1125692d62af38a5cdaa75465915e30;hpb=36b147d74705c795fb884507c3564477eb31e2bb
diff --git a/perl/sctweb b/perl/sctweb
index 9aef892..1ca3d7c 100755
--- a/perl/sctweb
+++ b/perl/sctweb
@@ -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, {
@@ -557,7 +559,7 @@ sub do_html_schedule {
sub do_html_grades {
my @readheaders = ("Section ID", "Course Title", "Grade", "Earned Hours", "Quality Hours", "Quality Points", "GPA");
- my @showheaders = ("Section ID", "Course Title", "Grade", "Earned
Hours", "Quality
Hours", "Quality
Points", "GPA");
+ my @showheaders = ("Section ID", "Course Title", "Grade", "Earned
Hours", "Quality
Hours", "Quality
Points");
my ($row, $lastrow);
my $te = new HTML::TableExtract( headers => [ @readheaders ] );
my $response = $ua->get("$url&tserve_tip_write=||WID|SID|PIN|Term&tserve_trans_config=rgrdterm.cfg"); # Valid grading terms
@@ -581,14 +583,19 @@ sub do_html_grades {
$lastrow=$row;
next if $row->[0] =~ /:/;
print '
// || s/\ / /; - s/<\/?[Hh]\d>//g; + s/<\/?([Hh]\d|[Bb])>//g; + next if /<\/td>/; print "$_\n"; } }