Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Bucharest, Romania
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 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.

    florinba

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    624
    Thanks
    1
    Thanked 20 Times in 20 Posts
    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"
    "http://www.w3.org/TR/REC-html40/loose.dtd">
    <html lang="en-US">
    <head>
    <title>Florinba</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-5">
    <meta name="Author" content="James A. Alarie - jalarie@umich.edu" />
    <link rev="made" href="mailto:jalarie@umich.edu" />
    <meta name="MSSmartTagsPreventParsing" content="TRUE" />
    </head>

    <body bgcolor="#ffffee" text="black"
    link="blue" vlink="#800088" alink="red">
    <!-- Page Header -->
    <center><h1>Florinba</h1></center>
    <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_Y=Now.getYear();
    Now_M=Now.getMonth(); // Jan-Dec = 0-11
    Now_D=Now.getDate();
    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
    document.write(DL_Item);
    }
    }
    // End hiding -->
    </script>

    <!-- Page Footer -->
    <br clear="all" /><hr />
    Written on June 26, 2002, by:&nbsp;
    <a href="mailto:jalarie@umich.edu">James Alarie</a>
    </body>
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •