Web Analytics Made Easy -
StatCounter requesting a script - CodingForum


No announcement yet.

requesting a script

  • Filter
  • Time
  • Show
Clear All
new posts

  • requesting a script

    Help, please!

    I really need a script to automatically load a html file (an article) on scheduled bases (i.e. in a month, to load every 2-3 days a different article).

    The problem is that I don't know the programming stuff, so, if somebody suggests some code lines, I won't be able to generate a whole script.

    I think that this is a problem that would interest many people, but I did't find an answer, yet.


  • #2
    The following does specific information on specific dates; perhaps it will help you get started:

    <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    <html lang="en-US">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-5">
    <meta name="Author" content="James A. Alarie - [email protected]" />
    <link rev="made" href="mailto:[email protected]" />
    <meta name="MSSmartTagsPreventParsing" content="TRUE" />

    <body bgcolor="#ffffee" text="black"
    link="blue" vlink="#800088" alink="red">
    <!-- Page Header -->
    <hr />

    <!-- Content -->
    <script type="text/javascript">
    <!-- Hide this code from non-JavaScript browsers
    Data_Lines=new Array(
    '06-25-2002,This is yesterday\'s information, '
    + 'continued onto a second line, and it should not print.',
    '06-26-2002,This should print today.',
    '06-27-2002,Tomorrow\'s stuff should not print.',
    '06-26-2002,Another item for today.',
    '06-30-2002,Final item has no trailing comma.'
    Now=new Date();
    Now_M=Now.getMonth(); // Jan-Dec = 0-11
    if (Now_Y < 70) { Now_Y=Now_Y*1+2000; }
    if (Now_Y < 1900) { Now_Y=Now_Y*1+1900; }
    Now_M=Now_M*1+1; // Jan-Dec = 1-12
    if (Now_M < 10) { Now_M='0'+Now_M; } // leading zero
    if (Now_D < 10) { Now_D='0'+Now_D; }
    Now_Date=Now_M+'-'+Now_D+'-'+Now_Y; // date as MM-DD-YYYY
    for (ix1=0; ix1<Data_Lines.length; ix1++) {
    Data_Line=Data_Lines[ix1]; // a single item
    ix2=Data_Line.indexOf(','); // find first comma (,)
    DL_Date=Data_Line.substring(0,ix2); // just the date part
    DL_Item=Data_Line.substring(ix2+1); // ...all the rest
    if (DL_Date == Now_Date) { // it is for today
    // End hiding -->

    <!-- Page Footer -->
    <br clear="all" /><hr />
    Written on June 26, 2002, by:&nbsp;
    <a href="mailto:[email protected]">James Alarie</a>
    Having said that, I've probably told you more than I know.