Software Garden SRCSVC Program
SRCSVC (a Software Garden® product) is a program for implementing a server-based service to view the source HTML code of a web page using a browser. It is a Perl program that runs as a CGI script on a web server. It is usually invoked using a bookmarklet while viewing a web page. The returned HTML will be a page that shows the source HTML that makes up the original page. The effect is similar to using "View / Source" or "View / Page Source" in a browser, with some nice additions:

  • Long lines are broken at a maximum length and wrapped, with the fragments indented appropriately.

  • href= and src= attribute values are displayed as links that either popup a window (for images), or display the contents listed by this program (html pages, css and Javascript files, etc.). This is useful for looking at the files in a frameset, or reading boilerplate Javascript.

  • The text is displayed in bold, with markup (tags, etc.) shown normally. This makes it easier to look through code when using the text as a guide.

  • You can optionally display in "short tags" mode with most HTML tags reduced to just their names, without the attributes or their values shown (except for href and src). This form is useful when you just want to understand the basic structure of a page. Indenting is preserved.

  • Values in the HTTP header are displayed below the listing. Most of these are not available in normal source listings or page info, since they come from the request itself. These include the server type, last modified date/time, cookies, etc. In addition, the protocol and status values in the response are displayed, along with the URI base. This base may be set by various HTTP/HTML means, and may be the result of redirection (and therefore not correspond to the requested URL).

  • A configuration file may be used to override default values for a variety of things.

Here is a sample output:

  http://www.oursite.com/  
 
<HTML> 
<HEAD> 
<TITLE>Our Site</TITLE> 
</HEAD> 
<BODY BGCOLOR="#000000">
<DIV align="center"> 
<table BORDER="0" CELLPADDING="6" CELLSPACING="10" COLS=2>
<tr><td bgcolor="#CC9933" width="50%"><font size="+2" color="#FFF
. . .FFF"><b>&nbsp;OUR SITE&nbsp;</b></font></td><td width="50%">
. . .&nbsp;</td></tr>
<tr><td bgcolor="#FFFFCC" colspan="2">This site is under construc
. . .tion for now.
<br>For questions, contact the webmaster (see "<a href="http://no
. . .where.not/contact.html">Contact Us</a>").
<P>
Thank you!</td></tr>
<tr><td width="50%">&nbsp;</td><td bgcolor="#CC9933" width="50%">
. . .<div align="right"><font size="-1" color="#FFFFFF">web site<
. . ./font></div></td></tr>
</table>
</div>
</BODY> 
</HTML>
RESPONSE HEADER VALUES
Connection: close
Date: Wed, 10 Jul 2002 15:47:38 GMT
Accept-Ranges: bytes
Server: Apache/1.3.26 (Unix)
Content-Length: 690
Content-Type: text/html
ETag: "fd5714-2b2-3e3d5712"
Last-Modified: Wed, 10 Jul 2002 15:47:30 GMT
Client-Date: Wed, 10 Jul 2002 15:47:38 GMT
Client-Peer: 64.64.188.198:80
Title: Our Site

RESPONSE PROTOCOL, CODE, AND BASE
HTTP/1.1 200 OK
http://www.oursite.com
Show rendered page  |  Short tags  |  Full tags

Page fetch: 0.12 seconds, Parsing: 0.01 seconds

 
 

How to get it

SRCSVC is available for download as an open source product with the copyright held by Software Garden, Inc., and subject to a Software License in the file. It is provided with no support and NO WARRANTY OF ANY SORT.

Here are links to various files for download:

  • Source in GZ Format, Zip Format, and Text Format. This is a Perl program. [Version 1.0, last modified 10 July 2002 12pm ET]
  • Documentation in text format (what you would get from "perldoc srcsvc").
  • The Software License for the program (a variation on the ones for Zope, Apache, and others, and included in the source).

Known issues (10Jul02):

  • None at present other than those listed in the source (e.g., it does not deal with security).


(c) Copyright 2004 Software Garden, Inc.
All Rights Reserved.

Software Garden and Garden are registered trademarks of Software Garden, Inc.
Dan Bricklin's is a registered trademark of Daniel S. Bricklin.