Forum Moderators: phranque

Message Too Old, No Replies

Creating a C++ or Java program to access pages at regular intervals?

Refreshing site pages from my computer

         

Kadence

12:30 am on Apr 23, 2004 (gmt 0)

10+ Year Member



I have a PHP script on my site that I want to run at regular intervals, but I can't do Cron jobs on my server.

I was wondering how I could make a C++ or Java program to access a particular page on my site and refresh it at regular intervals, say every hour?

Or if anyone could think of any other way to accomplish running the script regularly, that would also be appreciated.

chicagohh

3:13 am on Apr 23, 2004 (gmt 0)

10+ Year Member



Are you using Windows?

If so, you can set a schedule to run a simple WSH file that will access the page in question. I do it all the time.

In the WSH file you could do something like:

 url = "http://www.example.com" 
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
'content = xmlhttp.responseText
set xmlhttp = nothing
WScript.Echo(content)

Joe

EDIT: changed URL

bigm

3:18 am on Apr 23, 2004 (gmt 0)

10+ Year Member



Assuming you have a Windows server, and access to it, you could start IE at intervals by sheduled tasks.
That's how I do something similar on my windows server.

or you access the PHP file from your PC at the given intervals.

HTH

bigM

Kadence

5:23 am on Apr 24, 2004 (gmt 0)

10+ Year Member



Thanks chicagohh :) That script worked great.

I was having problems with Task Scheduler though so it took me a while to get everything to work. First I had a 'The data area passed to a system call is too small' error. This was fixed using the following .bat file:

[jsiinc.com...]

Also, you have to have a password for the tasks. Tweak #67 on this page makes it so you don't have to use a password:

[kellys-korner-xp.com...]

Maybe this info can help somebody else. Thanks guys.