Complete.Org: Mailing Lists: Archives: discussion: October 1999:
[aclug-L] Re: Automatically entering today's date in a subject line
Home

[aclug-L] Re: Automatically entering today's date in a subject line

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Subject: [aclug-L] Re: Automatically entering today's date in a subject line
From: Bob_Deep <bobd@xxxxxxxxxxxx>
Date: Fri, 22 Oct 1999 16:37:33 +0000
Reply-to: aclug-L@xxxxxxxxxxxx

Ryan Claycamp wrote:
> 
> A friend of mine would like to get a web page that changes daily, using
> the date as part of the file name.  I thought I could write a little
> script file to pull the file using wget and mail it to her including the
> date in the subject line.  My problem is that I don't know how to add a
> changing argument to the command line.

Hey, how's the linux server going there?  Seems you got things up and
running quite well at this point..

Ever thought about using a JAVASCRIPT to set a changing link for the
page on in an HTML document..  We do this to get the user friendly of
the day on our internal web pages.

We just put the following in our static HTML page...

<p>
<script language="javascript">

<!--cloaking device on

//Erik Fortin go to http://twilight.vtc.vsc.edu/~efortin/ for a good
time.
//Date: November 17 1998
//Note: Currently, this script does not compensate for the time zone. 
why bother?
// Well, I might.
// Edit the Value of text for different links. <a href="">text</a>
// Images can be the link this way.

var image="<img SRC=button_latest.gif >";
var text="Today's Userfriendly Link";
var century=19; //will increment if year<97
var monthstr; //holds mmm for MM
var c=new Date();
var day=c.getDate(); //day of month (1-x)
var month=c.getMonth()+1; //Get a month from 1-12, not 0-11
var year=c.getYear();

if (day < 10) day=("0"+day) //need a 2 digit day
if (month < 10) month=("0"+month); //need a 2 digit month too

if (month == 1) monthstr="jan"; //number to 3 letter mapping for month
if (month == 2) monthstr="feb";
if (month == 3) monthstr="mar";
if (month == 4) monthstr="apr";
if (month == 5) monthstr="may";
if (month == 6) monthstr="jun";
if (month == 7) monthstr="jul";
if (month == 8) monthstr="aug";
if (month == 9) monthstr="sep";
if (month == 10) monthstr="oct";
if (month == 11) monthstr="nov";
if (month == 12) monthstr="dec";

if (year<97) century=century+1;  //I think that working for ~100 years
is ok
//The directory uses a 2 digit year, so i can too :)

//actually get to the good stuff
document.write('<a
href="http://www.userfriendly.org/cartoons/archives/');
document.write(year);
document.write(monthstr);
document.write('/');
document.write(century);
document.write(year);
document.write(month);
document.write(day);
document.write('.html">');
document.write(image);
//document.write(text);
document.write('</a>');
//-->

</script>
<p>

-- 
      -=  Bob =-
Hey.. This is my mail and I charge for SPAM I receive...

[Prev in Thread] Current Thread [Next in Thread]