#!/usr/local/bin/perl -P
#;
#;  Perl Script to create a liftoff.html in ...sts-##/ dir
#;
#;
#;
#;  USAGE:  build_liftoff_html 69
#;
$author = "Tom Nguyen 9/22/95";


#;
#; check for parameter
#;
die "\nYou must specify a mission number to execute this script.\n\nUsage: build_liftoff_html ##  \-\- where ## is like 69 for sts-69 mission.\n\nby: $author\n" unless @ARGV;



$mission_num = $ARGV[0];
$edit_date = `date`;
chop $edit_date;
$mapdir = "/shuttle/missions/sts-$mission_num";

#;
#;
$htmlfile = "/ftp/www/shuttle/missions/sts-$mission_num/liftoff\.html";
print "Created html file: $htmlfile\n";

open (HTMLFILE, "> $htmlfile") || print "Error creating $htmlfile\n";

#;
#; trick is to do write this to a file until we get to EndofText string
#; at the same time we also insert text/replace text as necessary per our variables declared
#;
print HTMLFILE <<EndofText;


<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//">

<HTML>
<HEAD>
<TITLE>STS-$mission_num Shuttle Liftoff Home Page</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT=360; URL="http://www.ksc.nasa.gov/shuttle/countdown/liftoff.html">
</HEAD>

<BODY>
<A HREF="http://www.ksc.nasa.gov/shuttle/countdown/video/livevideo.jpeg"><img src="http://www.ksc.nasa.gov/shuttle/missions/sts-$mission_num/landing.gif"><p></A>
<i> Landing of Endeavour at 7:37:56am EDT 9/18/95<br>
Click here for NASA Select </i>


<H1>Shuttle Liftoff Home Page</H1><p>
<DL>
<DD><A HREF="http://www.ksc.nasa.gov/htbin/cdt_clock.pl">Click here to see the launch countdown clock</a>
<!-- shuttle.nasa.gov/ccc-data/launch.html -->
<DD><A HREF="http://shuttle.nasa.gov/">Click here to follow the shuttle's progress after liftoff</A>
<DD><A HREF="http://www-pao.ksc.nasa.gov/kscpao/status/stsstat/1995/months.htm">Click here for the Space Shuttle Status Reports</A>
</DL>

<H2> Shuttle Launch Status </H2> 
<DL><dd>
  Space Shuttle mission <A HREF="http://www.ksc.nasa.gov/shuttle/missions/sts-$mission_num/mission-sts-$mission_num.html">STS-$mission_num</A>

<p>
</DL>

<H2> STS-$mission_num Movies and Images </H2>
<UL>
<A HREF="http://www.ksc.nasa.gov/shuttle/missions/sts-$mission_num/images/images.html">STS-$mission_num KSC Electronic Photo Archive</A><br>
<A HREF="http://www.ksc.nasa.gov/shuttle/missions/sts-$mission_num/movies/movies.html">STS-$mission_num KSC Electronic Movie Archive</A><br>
</UL>

<i><H2> Note: </H2>
 <UL>
The image on this page from a NTSC video capture that is updated every 
minute from the T-5 hour mark of the countdown till launch.    At all 
other times, the view is either connected to the <A HREF="ftp://ftp.hq.nasa.gov/pub/pao/tv-advisory/nasa-tv.txt">NASA TV (NTV)</A> feed (<A HREF="ftp://ftp.hq.nasa.gov/pub/pao/tv-advisory/">Click here for Video Advisories</A>) or it
is a static video capture of an Orbiter Television (OTV) camera that 
is updated a few times a day. If you have a WWW browser that caches images, 
you may have to select "Reload Images" periodically to see these images 
change. You may also want to look into getting your own live <A HREF="http://btree.lerc.nasa.gov/NASA_TV/NASA_TV.html">NASA Television Feed by loading CU-SeeMe software on your system.</A></i><p>
</UL>

<hr>
<A HREF="http://shuttle.nasa.gov/"> <IMG SRC = "http://www.ksc.nasa.gov/images/NASA-logosmall.gif">Launch Home Page</a> <A HREF="http://www.ksc.nasa.gov/shuttle/missions/sts-$mission_num/countdown.html"> <IMG SRC = "http://www.ksc.nasa.gov/images/NASA-logosmall.gif">Countdown Home Page</a>
</BODY>

<hr>
<address>
Developed under the direction of the NASA/KSC Public Affairs Office <br>
<b>Authors: </b>
<A HREF="http://www.ksc.nasa.gov/persons/nasa-cm/tnn.html">Tom Nguyen</A> / NASA  (nguyen\@titan.ksc.nasa.gov)<br>
Mike Downs / NASA  (downs\@titan.ksc.nasa.gov)<br>
<b>Curator: </b>
<A HREF="http://www.ksc.nasa.gov/persons/nasa-cm/jmd.html">Jim Dumoulin</A> / NASA  (dumoulin\@titan.ksc.nasa.gov)<br>
<b>Coordinator: </b>Paula Shawa (Paula.Shawa-1\@ksc.nasa.gov) / SHER-10 <br>
<b>Last Updated: </b> $edit_date <br><p>

A service of NASA/Kennedy Space Center Public Affairs Office, <A HREF="/persons/nasa-pao/hwh.html"> Hugh Harris,</A>Director (Hugh.Harris-1\@kmail.ksc.nasa.gov)</address>


EndofText

close(HTMLFILE);