# $Id$
# -*- perl -*- vim: ft=perl sw=4 sts=4
+# Brief usage instructions:
+# Create a ~/.sctwebrc that has SID=yourssn and PIN=yourpin
+# You'll need to change the url below if you go anywhere but Northwest Vista.
+
use strict;
use LWP::UserAgent;
use HTML::TableExtract;
my @terms = grep {s/^<option value="([^"]*)">.*/$1/} (split( /\r\n/, $response->content));
die "Site down. Try again later.\n" unless (@terms);
-sub do_schedule {
+sub do_html_schedule {
my @readheaders = ("Section ID/Title", "Instructor", "Days", "Time", "Start/EndDates", "Site/Building/Room");
my @showheaders = ("Section ID/Title", "Instructor", "Days", "Time", "Start/End\nDates", "Location");
my $te = new HTML::TableExtract( headers => [ @readheaders ] );
print "</table>\n";
}
-sub do_grades {
+sub do_html_grades {
my @readheaders = ("Section ID", "Course Title", "Grade", "Attempted Hours", "Earned Hours", "Quality Hours", "Quality Points", "GPA");
my @showheaders = ("Section ID", "Course Title", "Grade", "Attempted<br>Hours", "Earned<br>Hours", "Quality<br>Hours", "Quality<br>Points", "GPA");
my ($row, $lastrow);
if(defined($ARGV[0]) && $ARGV[0] eq "-g") {
shift;
- do_grades;
+ do_html_grades;
} else {
- do_schedule;
+ do_html_schedule;
}
$ua->get("$url&tserve_trans_config=alogout.cfg"); # Logout