Building you script

Building a script that will open websites for you is easier than it seems. In order to build a script that will open websites for you, all you need to do is create a new text file. Once created you can open it and copy the following lines into it:

<script type=”application/javascript”>
function open65() {
window.open(‘http://google.com’,’_blank’);
}
open65();
setInterval(open65, 65*60*1000);
</script>

Once you have copied the above into your text file, you should be able to save it as an html file ( webopener.html ). Once you open this file in your browser. It will open google every 65 minutes.

Modifying your script

You can change http://google.com to any site you want to open and it will. If you want to open more sites you can update your script to the following:

<script type=”application/javascript”>
function open65() {
window.open(‘http://google.com’,’_blank’);
window.open(‘http://yahoo.com’,’_blank’);
window.open(‘http://bing.com’,’_blank’);
}
function open35() {
window.open(‘http://facebook.com’,’_blank’);
}
function open20() {
window.open(‘http://upclass.co.za’,’_blank’);
window.open(‘http://cyberdevs.co.za’,’_blank’);
}
open65();
open35();
open20();
setInterval(open65, 65*60*1000);
setInterval(open35, 35*60*1000);
setInterval(open20, 20*60*1000);
</script>

The above script will open Google, Bing and Yahoo every 65 minutes. It will open Facebook every 35 minutes and it will open Upclass and CyberDevs every 20 minutes.

You can easily modify the above to open websites as you need them. It is a bit technical but ultimately helps a lot when it comes to sites that needs to be visited regularly.

Explaining the Script

This is a brief description of what the script does.

Part 1 – The function:

function open65() {
window.open(‘http://google.com’,’_blank’);
}

This is a function that can be called at any time. All it does is it opens a website, google.com, in a new tab whenever called.

Part 2 – Call the function once the page opens:

open65();

This line simply runs the function when the file opens.

Part 3 – Call the function every 65 minutes

setInterval(open65, 65*60*1000);

The above code calls our function every 65 minutes. SetInterval runs anything within it every x miliseconds. We use 65*60*1000 as it converts minutes to milliseconds.

That is a technical explanation of our script.

This script automates the process of opening websites and if used right can save a person a lot of time. Time which in turn can be used elsewhere.