Hi there, apologies to any mods if this is in the wrong section.

I am a total novice to code, and need some help.

I have a page on my website which has a javascript box, that generates 10 time-stamped facebook links for me to click - this is the code:

<script type="text/javascript">
var d = new Date()

if(month.length<2) month = "0" + month;

if(day.length<2) day = "0" + day;

if(hour.length<2) hour = "0" + hour;

if(minute.length<2) minute = "0" + minute;

for (x=1 ; x<=10 ; x++)
    xx = x.toString();    
    if (xx.length<2) xx = "0" + xx;
    h= "http://xxxxxxxxxxxxxxx/xxxxxxxxxxxx/facebook.xxxxxxxxxx.php?F=xxxxxxxxxxxxxxxxx=" + d.getUTCFullYear() + "." + month + "." + day + "+" + hour + "." + minute + "." + xx + "xxxxxxxxxxxxxxxxxx";
    document.writeln("<p>"+("Link "+x).link(h)+"</p>");";
    document.writeln("<p>"+("Link "+x).link(h)+"</p>");
What I need to do, is to get these links generated every 8 hours, and automatically clicked to save anyone having to click them manually.

Is this possible? If so how do I do it and where do I go to learn how to do it?

I am guessing that code is fine and I have to write something for insertion into my server, but have no clue where to start or how to do it.


ps - also, what do I write into that script so the links generated open in a new tab?