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:

Code:
<script type="text/javascript">
<!--
var d = new Date()

month=(d.getUTCMonth()+1).toString();
if(month.length<2) month = "0" + month;

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

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

minute=(d.getUTCMinutes()).toString();
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>");
}
//-->
</script>
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.

Thanks

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