#!/usr/bin/perl # Script Name: Source Viewer (version 1) # Scripted By: U-L-T-R-A@webtv.net # Copyright © Date: 06-02-02 (Updated: 10-31-02) # Get this script & more at: http://ult-tex.com/ultra/scripts/ # Leave in all copyright statements & these 5 lines. # Set page variables. $heading = "Your Source Viewer"; $back = ''; $bg = 'ffffff'; $text = '505050'; $link = '1515ff'; $vlink = 'c000ff'; $trans = 'spinoutin'; $txtbxtext = '000080'; $txtbxtag = 'bc=ffffff cursor=ff nohighlight autoactivate usestyle'; $btntag = 'text=000070 insetselection'; # Environment variables. $agent = $ENV{'HTTP_USER_AGENT'}; $server = $ENV{'SERVER_NAME'}; # Required modules. use LWP::Simple; use CGI qw(param); # Read in the form inputs. $url = param('url'); $data = param('data'); print "Content-type: text/html\n\n"; if ($url) { $title = "Results for $url"; $URL = "'$url'"; } else { $title = $heading; $URL = 'history.previous'; } # Begin view document page. if ($data) { print "$data"; exit; } # Print the html header. &pc_block; print qq~
Powered By: $server~; # Begin the results page. if ($url) { $source = get($url); &error_msg; $source =~ s/<\/textarea>/<\/textarea>/gi; print qq~
~; } else { print qq~
Enter the url of the page you want to source or pick one from the recents menu or use the url of the previous page already in the textbox.
Click the "Source It" button and the script will read in the contents of the page you're sourcing and display the codes in a full width easy to read textarea where you can view and edit them. You can make changes and try different codes and preview the page and the changes you made by clicking the "View Document" button. There is also a very nice search and replace feature. NOTE! If the page you are sourcing has its source codes blocked then you will get an error message displayed with possible reasons for the error. |