Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

My rotator script


  • Please log in to reply
5 replies to this topic

#1 myeasybucks

myeasybucks

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:03:45 PM

Posted 10 January 2010 - 11:22 AM

Hi all,

I have this script that I found online 6 or 7 years ago. I was wondering if anyone here might be able to make it rotate sequentially? Seems to be totally random right now. Alternately perhaps someone could suggest another non commercial ad free rotator?


______________________________________________________________


<script language="">

var currentdate = 0
var speed = 0;

link = new Array(3)

link[0] = 'http://google.com'
link[1] = 'http://yahoo.com'
link[2] = 'http://bleepingcomputer.com'



window.setTimeout("reload()", speed);

function reload()
{
currentdate = new Date();
adcore = Math.floor(((currentdate.getSeconds())/60)
*link.length);
window.location = link[adcore];
}

//-->
</script>


___________________________________________________________


Thank you for your time,

Claude

Edited by myeasybucks, 10 January 2010 - 11:22 AM.


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:45 PM

Posted 10 January 2010 - 12:30 PM

Your script would somehow have to keep track of where it was in the list, which means that it would somehow have to modify itself. As long as the window displaying the link stayed open, that would work, but as soon as someone restarted the browser, it would start all over. So right off hand, I can't think of anyway to do it.

#3 myeasybucks

myeasybucks
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:03:45 PM

Posted 10 January 2010 - 01:12 PM

Thanx for the reply Groovicus,
I suppose that even with pages being show randomly there would probably be some equality to it. As long as you didn't put like 50 different sites into it. I don't really have a use for the rotator right now,was just curious. In case someone would like to play with it, here is the full info that I have on it:

Regards,
Claude

________________________________________________________




Many people use commercial rotators but just a simple script (a
little program) has the same function with the advantage of no advertising and the pages show at full screen.



The best of all is than you can to put a rotator within another
one!


This is the script:

----------------------------------------

<script language="">

var currentdate = 0
var speed = 0;

link = new Array(6)

link[0] = 'http://www.yoursite.com'
link[1] = 'http://www.yoursite.com'
link[2] = 'http://www.yoursite.com'
link[3] = 'http://www.yoursite.com'
link[4] = 'http://www.yoursite.com'
link[5] = 'http://www.yoursite.com'


window.setTimeout("reload()", speed);

function reload()
{
currentdate = new Date();
adcore = Math.floor(((currentdate.getSeconds())/60)
*link.length);
window.location = link[adcore];
}

//-->
</script>

----------------------------------------

The number in "new Array(6)" (6 in this case), always must
agree with the number of URL's. Be careful!


Copy everything between the lines and paste into an editor and
save it like rotator.html or any other name that you prefer :-)

Upload the file to your Web hosting like we have learned in the
past lesson. This is the link that you must promote.

#4 myeasybucks

myeasybucks
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:03:45 PM

Posted 10 January 2010 - 10:44 PM

Hello again,
I've been playing with this and watching my browser's address bar. It actually does display the sites in the order that I've entered them. It's just that it usually repeats each one 2-3 times. So I guess it would still give relatively equal exposure to each site. That was my real concern.

Regards,
Claude

#5 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:45 PM

Posted 10 January 2010 - 11:32 PM

It just appears to be, otherwise you wouldn't get the same one more than once in a row. The way that the links are displayed has everything to do with the value of speed. You can approximate a linear display by dividing one minute (in milliseconds) by the number of links, and using that for speed.

#6 myeasybucks

myeasybucks
  • Topic Starter

  • Members
  • 15 posts
  • OFFLINE
  •  
  • Local time:03:45 PM

Posted 11 January 2010 - 02:08 AM

Wow,
That's cool. I did as you suggested.(I think :thumbsup: ) And posted it to my host. As long as I timed my refreshes about 1.5 seconds apart it was almost perfectly linear. Of course in real life the hits wouldn't come perfectly timed. So it would still be totally random. Oh well, thanks for helping me play.

Claude




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users