X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=blobdiff_plain;f=perl%2Fsctweb;h=1ca3d7c4fa6044246989c58d09c0d131d8b57db9;hp=597ce83ccd00b63ccacd7ef2fe5a03192245be85;hb=57c2826cf1125692d62af38a5cdaa75465915e30;hpb=29288f09d3700d98c70b5c6a2f8354ece25f8c01 diff --git a/perl/sctweb b/perl/sctweb index 597ce83..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; } @@ -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 ''; - print join('', @$row); + print $$row[0], '', $$row[1], ''; + print '', $$row[2], ''; + #print join('', @$row[0 .. 1]); + print join('', @$row[3 .. 5]); print "\n"; } } print '', capitalize($lastrow->[0]); - shift @$lastrow; shift @$lastrow; + #shift @$lastrow; shift @$lastrow; print ""; - print join('', @$lastrow); + print $$lastrow[6]; + print ""; + print join('', @$lastrow[3 .. 5]); print "\n"; print "\n"; } @@ -615,7 +622,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/^\ |
// || s/\ / /;
-	s/<\/?[Hh]\d>//g;
+	s/<\/?([Hh]\d|[Bb])>//g;
+	next if /<\/td>/;
 	print "$_\n";
     }
 }