Now we have an ideal forum in which to tell our stories, the World Wide Web. A website's relatively cheap, so cheap that we can have 100 pages for a small monthly charge. And if done right, that website can bring us tons of new business.
Many Troubleshooters have already created websites. Others, unfamiliar with web creation and marketing process, haven't. This issue of Troubleshooting Professional gives the information and dispels some of the myths that hold Troubleshooters back from creating their own websites. It answers questions like "how do I build a website?", "how do I build it cheap?", "what tools do I use?", "how do I connect it with the web?", and "how do I market it?".
In short, this issue of Troubleshooting Professional Magazine tells you everything you need to inexpensively produce your own, professional website. Read and enjoy...
His words are even more true on the 'net. WRITE ABOUT WHAT YOU KNOW! This issue of Troubleshooting Professional is a perfect example. I know how to make and market a successful website, so I write it down, inform a few strategic link partners, and watch the hits come in.
It need not be anything earthshaking. Remember Jerry Buchanan and his mole hole book? Here are some website ideas that have been used successfully:
Everyone has some skills to construct a website. Are you a good writer? Make the website mostly written. Are you artistic? Make it mostly graphic. Great with video? Make it animated. Are you "cool"? Make it appeal to "cool" people. Are you "square"? Make it appeal to other "squares". Are you a great salesman? Use it to get leads you can close.
Inventory your skills. Before you start your site, know your areas of subject matter expertise, your areas of technical knowledge, your areas of communicational advantages. Now you're ready for the next step.
Put yourself in the shoes of those with original Win95, without any way of changing resolution except rebooting. Now let's see. To view the website "best", you need must StartButton/Settings/DisplayIcon/SettingsTab/800x600/ApplyButton. The computer now reboots, severing your Internet connection. When the reboot is complete, you log on with dial up networking, fire up your browser, and re-navigate to the site, which you can now see "best".
This line best read at 1024x768. It will walk off the end of a browser at 800x600 or 640x480. But hey, I'm in control.
It's just too darn easy to write for both major browsers, all modern versions. The easiest way is to use simple html. It's the lowest common denominator, and if your site's value is its information there's no need for "gee whiz" browser specific features. If you do need "gee whiz", there are plenty of products on the market that can author a site, detect the browser, and present the code the browser will understand.
There's one exception to this rule. If you're actively taking a position in the Browser wars, or if you're actively pro or anti Microsoft, or if you're actively pro or anti free-software, "teeing off" those with the "wrong" browser will endear you to the audience you really want. Under those conditions, by all means make your page browser specific. Heck, under those conditions, put in Javascript that tells the user with the "wrong" browser that he's using the "wrong" browser, and have a button for him to download the "right" one.
But the rest of us should respect the use's choice of browser. After all, he's our customer.
One more thing. The smart webmaster always tests finished pages with the various browsers used by 90% of his visitors (probably Netscape 2,3,4, IE 3,4,5).
Don't use blink.
Are these giants "technically challenged"? :-) No, they just listened to their customers, who told them frames are obnoxious, hard to use, and hard to navigate. A perfect example of that was the 1996 "Windows 95 Annoyances" site, which carved the screen into 4 or 5 uneven sections. Windows 95 Annoyances now defaults to frames off, and is ultra readable that way. If you haven't seen Windows 95 Annoyances and Windows 98 Annoyances, you should. They're a great source of useful information.
Why do webmasters use sticky frames? They want to provide a link without exiting their website, so they provide a link in a sticky frame with their navigation frame still showing. How clever! They alienate the visitor, and if the link is part of a link trade, they alienate their trading partner, who is likely to either remove his reciprocal link or put a conspicuous frame buster on the page. Frame busters have their own article in this issue.
On the other hand, if your site isn't primarily porn, violence, hate, etc. DO NOT include or link to any such material. You'll alienate a large portion of your audience. Parents will put child locks on your site, making it less convenient even for themselves. You might find yourself boycotted or mailbombed. If you're not trying to convey porn, who needs the hassle.
Be affirmatively vigilant with your links. If one of your outgoing links begins showing skin or advocating hate, eliminate it (assuming you're not that kind of site). If one of your links begins linking to adult sites, eliminate that link from your site. We all know that on the net you're only 5 clicks away from anything, but you're judged very strongly by the first and second click away from your site, so pay attention.
The smart web author will test any Javascript (and VBscript) on all versions of all popular browsers before unleashing them on the world. If the visitor comes in on the "wrong" browser, send him to a web page that his browser can handle -- don't give him a Javascript error.
In 1996, when half the population still used 14.4 modems, my wife took a course in web design. The instructor taught her something I've tried to live by since: each page should be 50K or less for a fast load. This includes not only the html file, but all the images it loads. With long pages like Troubleshooting Professional Magazine, that's a hard goal to meet, but I try.
Unfortunately, more and more webmasters are adopting the "worth waiting for" philosophy. I think they'll change their ways when the feedback comes in. A heck of a lot of users still use 56K modems, and the net itself is slower and more trafficked than ever.
Fortunately, there are a lot of ways to reduce load times. Make images small. There's software to do this. Often graphics can be reduced to just 16 colors, then saved as a (very compact) .gif. Troubleshooters.Com's home page is a good example. It has 29 different images, all less than 10K, most less than 4K, many less than 1K. For instance, the suggestion box is 552 bytes and the toolbox is 570 bytes. I've had many compliments and few complaints about loading speed.
When big graphics are necessary, use a thumbnail linked to the full picture. If the user is interested in the full picture, at least he knows what he's getting into. Same with video and sound. And the smart webmaster resists the temptation to load a huge graphic as an imagemap for the home page, at least unless he's only interested in corporate visitor coming in through a T1. But even those visitors have to leave the office eventually and surf with their trusty 56K at home.
Then there's Java... When I made the Symptom Description Wizard in Java, everyone loved it except for one thing -- it took 30 seconds to load. That wasn't so bad -- it used few proprietary classes. Many of today's corporate websites use Java with layer upon layer of class abstractions, and the load times show it. I know Java's powerful and robust, but something needs to be done about those load times. Fortunately modern browsers cache the Java classes just like they cache graphics, so at least you need wait only once.
In summary, the professional webmaster respects his or her visitors and makes every attempt to reduce load time below 15 seconds (10 would be better).
Broken links to other sites are generally more excusable than broken links to one's own site, because a webmaster has no control over changes made to external sites.
There's a simple procedure to prevent most of these->.
Most are caused by absolute urls that should have been relative. For instance,
let's say your website is in directory /home/bobby/public_html/, and your
index.html contains the following graphic code: <IMG SRC="/home/bobby/public_html/images/mygif.gif">.
Now you switch ISP's, and your new website is on /home/html/sites/bobby31.
You FTP your site from the old place to the new, and the code now
produces one of these->
.
Of course, the solution would have been to take out the /home/bobby/public_html/
entirely, and code it as <IMG SRC="images/mygif.gif">, a relative url.
Note the absence of a beginning slash. That's what makes it relative. The
relative code would work on the old server, the new server, any server,
and Bobby's hard disk.
But sometimes, due to quirks in HTML authoring tools, hard disk absolute addresses creep in. For instance, let's say Bobby does his web development on his D:\myprojects\homepage directory. Before FTPing his site up to the server, he can do a quality control check by using a find or grep command to find all instances of "myprojects" in .htm and .html files in the \myprojects\homepage tree. These probably will indicate an absolute address that should be relativized by taking out the "D:\myprojects\homepage\" and any "file=" or file:///.
Another problem is that a link or graphic inadvertently references something on the hard disk. When Bobby pulls up the server version in a browser on his computer, he doesn't see the broken links because the files ARE on his hard disk. The rest of the world sees garbage. The solution is simple. Bobby temporarily renames his hard disk development directory to \myproject\xhomepage. This will break any references to his hard disk, which will then be obvious as he browses. Once everything's OK, he renames the directory back.
After version 3, Paint Shop Pro changed directions, moving away from webmasters who wanted a simple pixel editor to cut up screen shots and other graphics, and into the crowded "graphics creation" market. They removed resizable selections, which were the mainstay of grabbing buttons and lists off screenshots, as well as placing and re-placing text. As a result, Version 3 is vital to you as a webmaster. You may, in addition, choose to additionally purchase their newest product, Version 5, or one of its many competitors.
For simple drawings, I like to use Micrografx Windows Draw. Easy to use, straightforward, $49.00. I draw it in Windows Draw, then convert it to GIF using Paintshop Pro 3, and do any necessary pixel-level tweaks in Paintshop Pro 3.
In summary, grab Paintshop Pro 3 now, before it's gone!
PFE is a wonderful text editor. It adds line numbers and other features that Notepad left out. Best of all, it can be configured to format different filetypes differently. Thus for PERL or C++ programs, you'd use auto-indenting with 3 space soft tabs. For HTML you'd turn off auto-indent. PFE is absolutely free, with no license hassles. That means you can install it on your computer and 200 of your favorite clients. You can grab it at www.lancs.ac.uk/people/cpaap/pfe/ (link at end of this issue). It's free -- grab it.
Sometimes a text editor isn't enough. You might want a text editor optimized to edit HTML, with knowledge and formatting of all the HTML codes. Gomer, Hot Dog Pro, Allaire Homesite are just a few of your choices. A couple years ago I used Gomer (shareware -- $20.00), and it was great. Assuming they've improved their product to keep up with new HTML developments, I can recommend it. One great move is to tell Netscape Communicator that one of these HTML code editors is the HTML editor (this configuration is explained in the Using Netscape Composer article in this issue).
I have no idea, but I'm glad they do. I have version 4, and it's PERFECT! You can upload an entire site tree at one time. You can define which file types should be transferred as ASCII, and which binary. If the upload bombs in the middle, logs show you where it croaked. Depending on how your ISP is set up, you can use it to change file permissions (absolutely necessary for CGI). And you can configure it for multiple websites at multiple ISPs.
Many web authoring tools offer a "publish" option. I've always found those hard to deal with. Instead I use WS_FTP. Whether I'm transferring 1 file or the whole of multi-megabyte Troubleshooters.Com, it's trivial. Go to Ipswitch, grab your WS_FTP.
Warning: as soon as you've decided MapEdit is the product for you, pay the $25.00 and register it. Once that 30 days goes by, your demo won't work and it's tough to hack it into functionality. I had this happen once, and had to work for a few days in an inferior product, and boy did I miss MapEdit.
Not Netscape Composer. In Normal style, pressing the Enter key once gives you a <br>. Pressing it twice in succession gives you a <P>. However, pressing the Enter key at the end of a non-normal style (i.e. H1) creates a <P>.
In Netscape Gold 3, you'd make a non-breaking space with the Shift-spacebar combination. I think I liked that better. In FrontPage 97 (the latest FrontPage I purchased), the only way I could find to insert a non-breaking space was via Insert/Html Markup, then type in .
Since the symptom isn't particularly harmful, you may choose not to invoke the solution immediately, but instead work for a while with the old graphic displaying, knowing you can fix the display at will.
<META HTTP-EQUIV="Content-Type" CONTENT="text/html> or <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">Once you've done that, the document will know its name and save properly.
To make it easier to fix a whole site at a time for Netscape Composer editing, I have created PERL program FIXHTM.PL.
Free means a lot more than saving a few bucks. It means freedom.
Button | Placement | Effect |
![]() |
Highlighted text | Click this to create a link. Highlight the text you want to indicate the link, click the link button, then navigate to the desired file, target, combination, or URL. BE SURE to remove any file=, file:/// and any absolute addressing in the link properties dialog box. |
![]() |
Insertion point | Click this to create a target. A target is the destination of a link. Targets are used most often with links that jump to another point in the same file (page). For instance, each article in Troubleshooting Professional Magazine is a target, and is jumped to by links in the table of contents. |
![]() |
Insertion point | Click this to insert an image. It will bring up the Image Properties
dialog box. From there, use the Choose File button to navigate to the gif
or jpg you want to insert. Once you've chosen it, an ABSOLUTE url starting
with file:/// will appear in the Image Location field. To make it relative
you must erase the file:/// and the front part of the path defining the
location of the html file, and the backslash after that. From there on
it's relative.
In the "Text alignment and wrapping around images" graphic radio button set, you can change how the image relates to the text in its paragraph. If you want to have alternative text for non-image browsers, do that with the Alt Text/Low Res button. Finally, if you want the image to be a link to a file, target, or another image, fill in the info on the Link tab. When you're done, click the OK or Apply button. |
![]() |
Insertion Point | Click this to insert a horizontal line. |
![]() |
Insertion Point | Click this to insert a table. The details of tables are beyond the
scope of this article, but here are some of the things you can do with
a table:
|
![]() |
n/a | Click this to spell check your web page. |
![]() |
Paragraph or highlighted paragraphs | Click this to change paragraph style. |
![]() |
Subsequent typing or highlighted text | Click this to change text to fixed or variable width. |
![]() |
Subsequent typing or highlighted text | Click this to change text size. |
![]() |
Subsequent typing or highlighted text | Click this to change text color. |
![]() |
Subsequent typing or highlighted text | Click this for bold. |
![]() |
Subsequent typing or highlighted text | Click this to remove all styles and links. |
![]() |
Paragraph or highlighted paragraphs | Click this to make a bulleted list. |
![]() |
Paragraph or highlighted paragraphs | Click this to make a numbered list. |
![]() |
Paragraph or highlighted paragraphs | Click this to decrease the indent of a paragraph. This is especially useful in a bulleted or numeric list, where decreasing the indent is like promoting the paragraph in the outline. |
![]() |
Paragraph or highlighted paragraphs | Click this to increase the indent of a paragraph. This is especially useful in a bulleted or numeric list, where increasing the indent is like demoting the paragraph in the outline. |
![]() |
Paragraph or highlighted paragraphs | Click this to change the justification of a paragraph (or several highlighted
paragraphs). You'll then get a choice between left, right and center, dropping
down as three buttons looking like this: ![]() |
The home page is usually the first page seen by visitors, and contains
links to the various other sections of your website. Run Composer, choose
File/New/Blank_Page. On the first line, put the title (like Bobby's World).
Hit Enter twice to make a new paragraph. Now highlight Bobby's World, click
and choose center, then click
and choose +4, then click the text color dropdown
and choose very dark red. Many modern big corporate sites use very dark
red titles, so it's a safe choice in 1998. Save as \practice\bobby\index.htm.
If you're asked for a page title, put Bobby's World. Open in a browser
with the preview
button, click the browser's reload
button (always reload to make sure you have the latest revisions) and notice
how it looks. You've made a web page.
Finish it off by setting the document properties. From the menu, choose Format/Page_colors_and_properties. You'll get the Page Properties dialog. On the General tab, make the title Bobby's World. That's what will show up on the browser's title bar when a visitor visits. For author put your name. For description, put Bobby's Home Page. That's read by many search engines.
On the Colors and Backgrounds tab of the Page Properties dialog, change the background color to white. Modern big corporate sites are using white background, so it's a safe choice in 1998. Click OK on the dialog box, save the file, then exit Composer. Finally, reload the browser you already opened and check your work.
Click OK to get back to the editing page, and fill out the lines as follows:
Line | Text Size | Justification | Text |
1 | +2 | Center | Bobby's World Presents |
2 | +4 | Center | Bobby's Dog |
3 | 0 | Left | Bobby's dog is black, and is named Bill. |
Save it as \practice\bobby\bobdog.htm.
Now highlight the words Bobby's World on line1, click the link
button, click the Choose File button, and navigate to index.htm and choose
it. You've just made a link back to the home page. Now File/Save. Do not
close this file.
Now highlight the words "Bobby's Dog", click the link button
and navigate to bobdog.htm, thereby creating a link to the Bobby's Dog
page. Now save the page, and preview it
and reload the browser
.
Note that you can navigate the links from the home page to Bobby's Dog,
and back again.
You now have the skills to make rudimentary web pages. The rest is just practice.
Nationwide, there's a fairly standard $20/month price for dialup plus hosting of a small, non commercial website without a domain name. It's always against the rules to have this type of site accept credit cards, it's usually not acceptable to advertise a product on this type of site and give an address to mail a check, but it's often OK to state that you sell a product or service, brag about the product or service, and provide an email link. If all you need is a place to stick your online resume or briefly talk about your network marketing organization and show pictures of your family, this might be enough.
But probably not. If you're serious about business on the 'net, you'll want a domain name (discussed in the next article). Having a domain name assures you that no matter where you choose to host your site, incoming links (your main source of visits) will remain intact. Without a domain name, you're totally at the mercy of your ISP. That's because if you have a problem with them and decide to take your business elsewhere, every incoming link you had will break. All the traffic you've built up will go back to zero.
Business or commercial web hosting comes in all sorts of prices and qualities. I've seen hosting for as little as $14.95 with a domain name, and as much as $190.00. It's an immature market, and there's not much reason to think you "get what you pay for". Those stratospherically priced hosting services often depend on the customer's (mistaken) notion that the website must be hosted in the same city as the customer and his dialup. Nothing could be farther from the truth. High quality web hosts can be found all over the country. As long as they keep your site up reliably, and respond to your emailed trouble reports quickly, they're just as good as a local host.
I use Pacificnet in California for web hosting, even though I now live in Orlando Florida and use (at least for now) Earthlink for dialup. Pacificnet charges $75.00 for a site with web hosting, but for that price they can set up more than 1 domain to the same IP address, so as a result they host Troubleshooters.Com, ProblemSolving.Com, and SteveLitt.Com for that $75.00 figure.
When seeking an ISP, look for people who are responsive to your needs, and technically knowledgeable. Keeping a website on the air 99% of the time is a technical challenge not everyone's up to.
So in summary, if you're serious about your website helping your business, get a domain name for site and link portability, shop around (not just in your city) for a good ISP to host your website, and go with them. Get dialup from any old company -- if their service is inadequate (and many are) just switch. Because you might need to switch, select a dialup provider who doesn't charge you a "setup" fee.
Here's the major benefit. Lets say I didn't have a domain name, but instead kept my website at www.highquality.net/~slitt/. Lets say that I had 150 incoming links that I'd cultivated over the years (in fact, that's my best estimate of the number of incoming links to Troubleshooters.Com). Those links result in 400 visitors a day, once again built up over the years.
Now lets say HighQuality.Net is bought out in a hostile takeover by Greedy Inc. who promptly raise my monthly fee to $350/month. Here are my choices. I can pay the $350, or I can switch to another provider, let's call them Reasonable.Net, who charges $60. But if I make the switch, my net address now changes to www.reasonable.net/~slitt/. Every link to the old address breaks. Those 400 daily visitors are gone. Now I suppose Greedy Inc. could be nice guys and put a forwarding address at the old address. Sure, and the Easter Bunny will come around dispensing hundred dollar bills.
Now imagine the same scenario, but I had the domain name Troubleshooters.Com. I simply switch to Reasonable.Net, have them set up the accounts, then while they're doing that, I go online and fill out an Internic change form for Troubleshooters.Com, changing the IP address from highquality.net's to reasonable.net's. Once Reasonable has set up my account, I simply FTP my site to them, and I'm back on the air with all my links working, still getting 400 visitors per day.
If your intended domain name is trademarked, (in other words, your intended domain name is carrepair.com and somebody has trademarked the phrase carrepair), the trademark holder can shut you down by mailing a letter to Internic, WHETHER OR NOT YOUR USE OF THE DOMAIN NAME CAUSES CONFUSION IN THE MARKETPLACE.
In other words, although Internic applies trademarks as a reason to shut down your domain name, they don't apply the trademark law in determining infringement. Even if your use of carrepair.com is the repair of cars, and the trademark holder markets Carrepair brand ice cream, you're still shut down.
And don't think you can necessarily win in court, even in such an obvious case of NON-infringement (no confusion in the marketplace). Alarmed at the rate at which quick-thinking small businesses were snatching up domain names, the big money boys lobbied government to institute "trademark dilution" statutes. The theory of "trademark dilution" is that if a trademark is "famous" (no definition of "famous" exists in the statutes), then ANY use of that mark, whether or not it infringes (confusion in the marketplace), is forbidden. That means that the guy with Carrepair brand ice cream can sue you and maybe win (if his mark is deemed "famous"), if you use carrepair.com as an address for your car repair site. Add to that the fact that most trademark holders are big corporations, so even if their case has no merit they can simply place the domain name holder under litigation siege until the domain name holder can't pay further legal fees.
The best defense against all of this is to make sure your intended domain name is not trademarked or in the process of being trademarked, then once you get the domain name put content up there very quickly showing in no uncertain terms the domain name, and record the date first displayed. That way if somebody later trademarks Carrepair, they'll have a much tougher time going after you. You may even wish to trademark your new domain name (present Internic resolution policy favor trademarking just the second level, i.e. "CarRepair", rather than the first and second "CarRepair.Com", but this seems to change with each new Internic Resolution Dispute policy. Obviously, how you trademark your name is beyond the scope of this article.
If you want to read a domain name/trademark horror story, go to www.clue.com. After reading their story you just might write your congressman to change the trademark laws.
One thing that's becoming popular now is using your name as a domain
name. It's much harder for somebody to claim your name infringes on a trademark
(unless your name happens to be Kenny Rogers or something like that).
Absolutely! The tooth fairy and Santa Claus will come. The rest will never find an unadvertised website.
There are only a few ways for visitors to find you:
Even if you can cut it finer, (skiing Big Bear, for instance), you'll need to guess what potential visitors will be putting in their search. Will it be "skiing Big Bear", "skiing at Big Bear", "ski Big Bear", "Big Bear skiing"? Yes, I know there are methods to "spoof" search engines to bring you higher, and I've used them, but so is everyone else. Generally speaking, search engines are a small help -- beer money, if you will.
The one exception is an uncommon category. For instance, if you have a fan club for the music group Grunge Puppets, it's very likely you'll come up first page on anyone seeking info on that band.
So when people email you saying they can "get you registered with 100 search engines", keep in mind that only about 10 of those search engines are capable of providing substantial traffic, and you can easily register with them yourself. And keep in mind a lot of those smaller search engines are nothing but address-collection arms for big spam operations. Stay away from them.
A better reason for a webmaster to place an outgoing link is because the information on your page is so valuable that linking to it enhances the webmaster's site. That's why a high quality site is essential -- nobody will place a link to "brochureware".
Troubleshooters.Com has a proprietary method for obtaining incoming
links, but it's beyond the scope of this article. I may put it in a book
some day (hey, we can't give everything away :-).
Unless your site is high quality and informative, and curious visitors link to it from their own sites. This is likely to happen, and is the best reason I know to try to get your site mentioned in alternative media.
This section wouldn't be complete without mentioning the oft-mentioned "put your URL on your cards and stationary". Yes, of course you should, but don't expect that to bring in much traffic. Every little bit helps, but realistically how many people will see your cards and stationary, and especially, how many fresh new customers will see them.
Word of mouth helps, but it is a slow way to increase your traffic. Given the growth of the internet and proliferation of new sites, if you're standing still you're moving backwards. Your main thrust should be obtaining site to site links and being mentioned in the media.
The rule of thumb is probably this. If your links are useful, well organized and on-topic for the webmaster, he'll be more likely to link to your link page. If it's just a bunch of links thrown together, he probably won't.
If you want to see a really first class link site, see Hal Director's "Lost in Cyberspace" site (Url listed at end of this issue).
Recent experiences with Troubleshooting Professional Magazine certainly agree with Kassof. Troubleshooting Professional was traditionally a low-traffic subsite -- almost a labor of love. Then came April and May 1998 issues, which were seriously anti-Microsoft. By doing this I blew off 95% of the total possible audience.
But those other 5% loved it. Those issues were huge. During the second and third week in April, Troubleshooting Professional was the second most hit page at Troubleshooters.Com, single-handedly increasing total site stats by 25%.
Here are some resources to help your site's visitors escape from truly obnoxious sticky frames. First, let's set up a sticky frame with a link back to this page so you can see the problem:
Click here for the obnoxious and frustrating sticky frame page.
I've licensed it as GNU style free software. To obtain a copy of the license, click here. To copy the license to your local drive, right click the previous link, then select "Save Link As...", and save it as license.txt in the directory holding your copy of FIXHTM.PL.
You can copy the program to your hard disk as follows:
#***************************************************************************** # FIXHTM.PL: Fixes all .htm/.html files in a tree for editing # with Netscape Composer. # Copyright (C) 1998 by Steve Litt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Steve Litt, Orlando, FL. USA, Steve Litt's email address or # http://www.troubleshooters.com. # #***************************************************************************** #***************************************************************************** # A NOTE FROM THE AUTHOR # # This program is not guaranteed to work, and could cause data loss. # If you have a problem with that, do not use the program. # If you do decide to use the program, I HIGHLY RECOMMEND # backing up the root of the tree you're processing before # running this program on that tree. # #***************************************************************************** #***************************************************************************** # USE OF THIS PROGRAM # # This program is run from the command prompt of a DOS or # WINDOWS operating system as follows: # # perl -w fixhtm.pl # # This program will traverse the tree, whose root is defined # by the current directory from which the program is run. It looks for # any .htm or .html files. When it finds one, it will search the # heading between the <head> and </head> codes, and if a # <META HTTP-EQUIV="Content-Type" CONTENT="text/html"> code is # not found, it will insert one. It is that code that allows # Netscape Composer to remember the filename and title of a # web page. # # Fixhtm also writes a log file entry for each file it accesses. # Successful fixes, or files which already had the proper code, # go in log file fix.log, while files encountering an error are # written into log file err.log, all with the proper messages. # fix.log and err.log are overwritten each time the program is run, # so it's necessary to view them immediately after each run. # # # Note that to use this program in a UNIX type environment, # the backslash directory separator needs to be replaced with # a forward slash directory separator. Be careful, because # in PERL a literal backslash is "\\", but a literal forward # slash is "/". Note also that when a regular expression contains # literal forward slashes, the regular expression separators must # be something else, usually pipe symbols, as in: # # if ($mystring =~ m|/var/johnson/public|) {print "Johnson\n";} # #***************************************************************************** #***************************************************************************** # Main routine handles log files and calls # recursive directory parser onedir(), which does all the work. #***************************************************************************** open(FIXLOG, ">fix.log") or die "cannot open fix.log for output."; open(ERRLOG, ">err.log") or die "cannot open err.log for output."; &onedir("."); close(ERRLOG); close(FIXLOG); print "\n"; #***************************************************************************** # Onedir() is a recursive directory parser. It finds all files and directories # in directory $_[0]. Each FILE is that has an extension of .HTM or .HTML # invokes a call to fixfile() with the file's entire path as an argument. # Fixfile() is the routine that actually inserts the meta-tag. # # Each DIRECTORY found invokes a (recursive) call to onedir() using that # directory appended to the $_[0], thus "traversing" the tree. # # Onedir() also writes a log file entry for each file it accesses. # Successful fixes, or files which already had the proper code, # go in log file fix.log, while files encountering an error are # written into log file err.log, all with the proper messages. # fix.log and err.log are overwritten each time the program is run, # so it's necessary to view them immediately after each run. # # NOTE: This source code was written for DOS/WIN convention of directory # elements separated by a backslash. To change to a UNIX environment, # replace these separators with a forward slash. #***************************************************************************** sub onedir { my($dirname) = $_[0]; print "$dirname: Searching for webpages...\n"; opendir(DIR, $dirname); my(@AllNames) = readdir(DIR); my($Name); foreach $Name (@AllNames) { chomp($Name); my($Path) = "$dirname\\$Name"; if( -d $Path ) # if path represents a directory { if(($Name ne "..") && ($Name ne ".")) { &onedir("$Path"); } } else # if path represents a file { if($Name =~ m/\.HTML{0,1}$/i) # if it's a .htm or .html { my($status) = &fixfile($Path); # fix it print " $Path: "; print $status; print "\n"; if ($status =~ m/^-/) { printf ERRLOG "%24s: %s\n", $status, $Path; } else { printf FIXLOG "%24s: %s\n", $status, $Path; } } } } } #***************************************************************************** # Fixfile() reads the .htm or .html file. If a # <META HTTP-EQUIV="Content-Type" CONTENT="text/html"> type # tag is not found between the <head> and </head> tags, one # is inserted. If one is found, or if there's no <head> or no # </head> tag, the file is left unchanged. # # This subroutine returns a string message. If the string begins # with a plus sign, the message is informational. If it begins # with a minus sign, the information is an error message. #***************************************************************************** sub fixfile { #*** READ FILE INTO LIST *** my($fname) = $_[0]; open(MYINPUTFILE, "<$fname"); my(@lines) = <MYINPUTFILE>; # read file into list close(MYINPUTFILE); #*** OPEN OUTPUT FILE WITH SAME NAME *** open(MYOUTPUTFILE, ">$fname") or die "cannot open $fname for output."; #*** READ, PARSE AND FIX *** my($returnValue) = "bUnknown Error"; my($line); my($headstarted) = 0; my($headfinished) = 0; my($alreadyfixed) = 0; foreach $line (@lines) { chomp($line); if($line =~ m/<head>/i) { $headstarted = 1; } if($line =~ m|<META\s+HTTP-EQUIV\s*=\s*\"Content-Type\"\s+CONTENT\s*=\s*\"text/html|i) { $alreadyfixed = 1; $returnValue = "+Previously Fixed"; } if($line =~ m|(.*)(</head>)(.*)|i) { $headfinished = 1; if ( ($alreadyfixed != 1) && ($headstarted == 1) ) { print MYOUTPUTFILE "$1\n"; print MYOUTPUTFILE "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html\">\n"; print MYOUTPUTFILE "$2$3\n"; $returnValue = "+Fixed"; } else { print MYOUTPUTFILE "$line\n"; } } else { print MYOUTPUTFILE "$line\n"; } } if ($headstarted == 0) { $returnValue = "-No <head> in file"; } elsif ($headfinished == 0) { $returnValue = "-<head> unmatched by </head>"; } #*** CLOSE AND RETURN *** close(MYOUTPUTFILE); return($returnValue); } |
Ralph was a high school buddy -- the only one with whom I kept contact. A great friend, a close friend. A successful salesman mingling with lawyers, businessmen and even a state senator, but always having time for his techie buddy Steve Litt in Los Angeles. Ralph had time for all his friends. He made the time. Friendship was important in his life.
And it was reciprocated. When I saw him almost a month ago, he was receiving an average of 20 visitors a day. Ralph, can I bring you some food? Ralph, can I get you anything from the store? Ralph, can I make you more comfortable? I saw his next door neighbor watering Ralph's lawn and commented how nice it was of him. The next door neighbor smiled and said "Ralph would do the same thing for me".
Ralph was a cracker-jack salesman. I had always planned to go on a sales call with him to see how he did it, but I procrastinated and some day never came. But I think I know how he did it.
I'd like to share it with you. It's simple: Ralph liked people! When somebody goofed up, he'd say "Wow, so and so goofed up". The person wasn't bad or stupid, they just goofed up. But let somebody do good, and Ralph would say "Wow, so and so is sharp". He liked people, people liked him, so doing business was easy. The money naturally followed.
Ralph had no wife and no children. A real shame because a gene pool like his should be preserved. And Ralph would have made a wonderful father. But there were no children -- he left nothing behind. Or did he?
A person's genetics are diluted beyond recognition within four generations, but his idea's can live a thousand years. When my children ask about selling, Ralph's ideas will be discussed. When they want to know about friendship, Ralph will be a model. Multiply me by literally hundreds of his other friends. Ralph leaves a lasting legacy of love, friendship and harmony.
Thanks for bearing with this off-topic article. I couldn't help writing it. And actually, maybe it's not so off topic at all. Because hot computers, cool websites, and perfectly tuned cars just aren't that satisfying without friends and loved ones to share them with.
Ralph, you will be missed. And remembered.
By submitting content, you give Troubleshooters.Com the non-exclusive, perpetual right to publish it on Troubleshooters.Com or any A3B3 website. Other than that, you retain the copyright and sole right to sell or give it away elsewhere. Troubleshooters.Com will acknowledge you as the author and, if you request, will display your copyright notice and/or a "reprinted by permission of author" notice. Obviously, you must be the copyright holder and must be legally able to grant us this perpetual right. We do not currently pay for articles.
Troubleshooters.Com reserves the right to edit any submission for clarity or brevity. Any published article will include a two sentence description of the author, a hypertext link to his or her email, and a phone number if desired. Upon request, we will include a hypertext link, at the end of the magazine issue, to the author's website, providing that website meets the Troubleshooters.Com criteria for links and that the author's website first links to Troubleshooters.Com. Authors: please understand we can't place hyperlinks inside articles. If we did, only the first article would be read, and we can't place every article first.
Submissions should be emailed to Steve Litt's email address, with subject line Article Submission. The first paragraph of your message should read as follows (unless other arrangements are previously made in writing):