#!/usr/bin/perl # Author: Kevin P. Inscoe . # File: fhp_display.pl # Date of creation: March 24, 2003. # Warranty: None expressed or implied. # License: The Open Software License. V1.1 http://www.opensource.org/licenses/osl.php # # OSI Certified Open Source Software. http://www.opensource.org/licenses/ # # Prerequisites: Perl 5.004 (minimum). # The purpose of this program is # Requirements require 5.004; use strict; use CGI; # Generic CGI support use CGI::Carp qw(fatalsToBrowser); use LWP::UserAgent; #Turn off Perl buffering $| = 1; # Display headers print "Content-type\: text/html\n\n"; print "\n"; print "\n"; # Globals my $URL = "http://www.fhp.state.fl.us/traffic/crs_h407.htm"; # Locals my $revision="1.0"; my $progname = "fhp_display.cgi"; my $ua = new LWP::UserAgent; $ua->agent("Trooper Al/0.1" . $ua->agent); my $req = HTTP::Request->new(GET => $URL); my $res = $ua->request($req); my $body = $res->content; if ($res->is_success) { # replace body bgcolor to black and text color to lime $body =~ s///g; # replace table back grounds to antique white $body =~ s/#182094/#FAEBD7/g; # replace incidents number text to red $body =~ s/color="white"/color="red"/g; print "$body\n"; } else { print "Could not retrieve remote site. " . $res->status_line . "\n"; }