How to load one web page every 12 minutes ?

Hello,

I would like to make to reload a page every 12 minutes.
The goal is to avoid the session to be closed and to have to relogin each time.

I have no idea how to do it... specially how to avoid "blocking" the mac during it will wait for 12 minutes or so.
Perhaps by using a cron with an applescript to turn it on or off... is it possible ?

My idea:
Safari is already opened and I am already logged in in that site.

Launch the App made with applescript.
Cron is started

Relaunch the Applescript, cron is stopped.

Thanks a lot.

PowerMac G4 Dual 1.25Ghz, Mac OS X (10.4.11), PowerBook G4 500Mhz

Posted on Jun 10, 2009 1:33 AM

Reply
6 replies

Jun 10, 2009 10:39 AM in response to Stf

Or by crontab: Lets see if I can lay this out if you have never done a crontab, but Bob's answer is faster and simpler. Which will be quite obvious very quickly.
sudo pico .crontab gets
# minute hour mday month wday command
*/2 * * * * open http://www.manpagez.com/man/
# */3 * * * * open /Users/dougp/Desktop/Untitled.app
*/3 * * * * sudo /sbin/shutdown -h now
The only active command is the top one and change the 2 to 12 or experiment with 2 and see results. Safari doesn't have to be open and any open page, if it is open, will go to background when crontab loads your called page and reloads at 12 minutes. You'll see. That's why I say use 2 to get the idea. So. copy this: # minute hour mday month wday command
*/2 * * * * open http://www.manpagez.com/man/
in your home directory and save as .crontab then type: crontab /Users/yournamehere/.crontab which sources the file(basically knows it exists now). Then run crontab -l to see if all is listed and crontab -r stops the crontab. If you stop it resource it . Now if you did all this bs, then in either 2 or 12 minutes you should see the man page load. I know there has to be an easier way to explain this. sorry for the verbosity.

Jun 11, 2009 6:03 AM in response to Stf

You could look at Platypus
<http://www.versiontracker.com/dyn/moreinfo/macosx/19870>

Platypus will allow you to turn a shell script into a double-clickable application. It has a lot of options, and it might have the kind of kill option you want. It is worth a look anyway.

There is also creating an Applications -> Automator -> Run Shell Script - Workflow.

And finally an AppleScript using "do shell". Some google searches will turn up examples that you can then adapt to your needs (maybe).

In all of these, it is the infinite loop that you want a way to terminate. You may need to experiment with that.

Jun 11, 2009 6:15 AM in response to Stf

OK, I just created a stupid infinite loop shell script, and wrapped it via Platypus.

I specified a "Output" was a "Text Window".

When I double-clicked on the applications created by Platypus, it displayed a window, with a "Cancel" button.

The infinite loop ran until I clicked on the Cancel button.

So I think you could use Platypus to do what you want without needing to open Terminal.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to load one web page every 12 minutes ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.