Page 1 of 1

Run remote page as "External programs"

Posted: Sat 24 Aug 2013 1:20 pm
by JacquesD
Hi,

I'm about to play with idea to avoid Cron job for website updates
and I'm curious about "External programs" feature. So, are we able
to launch a web page as an "External program"?

Example, to stay-in-touch with realtime.txt updates, I could have a page
to process it on website as soon as it arrive, with something like:
http://mysite.com/Read_RealTime_file.php

So, is this possible or maybe an other way?

Thanks in advance,
Jacques

Re: Run remote page as "External programs"

Posted: Sat 24 Aug 2013 1:44 pm
by steve
You can do it using wget as the command

Re: Run remote page as "External programs"

Posted: Sat 24 Aug 2013 5:05 pm
by gluepack
Well, not understanding Steve's response (my problem), I don't know if it is overkill or not but all browsers can be invoked from the command line so you can run it (or a batch file to invoke it) from "external program".

So, your web page can be the start page and it can be a php script.

The only problem is that not all browsers permit closing, without human interaction, and those that do use different techniques e.g. I believe you can use javascript with IE but not Firefox, although there is a setting in the latter that enables you to accomplish it in a different way.

I am not an expert by any means but you can Google, like I did, " automatically close browser", or something similar, and, separating the wheat from the chaff, you may come across a suitable technique.

Obviously, as you are only using it as a tool to run a php script, it doesn't have to be your favorite browser or even a mainstream one.

Or... use wget ;)

Re: Run remote page as "External programs"

Posted: Sun 08 Sep 2013 12:55 pm
by laulau
Hi,

did someone run a php script successfully using wget ?

Thanks in advance

Re: Run remote page as "External programs"

Posted: Sun 08 Sep 2013 11:28 pm
by BigOkie
laulau wrote:Hi,

did someone run a php script successfully using wget ?

Thanks in advance
I have, sometime ago. It can also be done with curl, of which both have ports for Windows.

Re: Run remote page as "External programs"

Posted: Mon 09 Sep 2013 6:01 am
by laulau
Perhaps a command line example with wget running a php script on a remote sever ?
(i like to use http://wiki.sandaysoft.com/a/ImportCumulusFile to populate my realtime database on the server)

Re: Run remote page as "External programs"

Posted: Tue 10 Sep 2013 10:29 pm
by JacquesD
Hi,

As I always want simple things (for Dummies), I wanted something
to suit my habits for "Throw all in the folder and Run" projects.

So, VBS is available on all Windows system via the little utility file; cscript
Then, only a few lines is needed to launch a page via a browser:
(I used Internet Explorer as it is included in each Pc... please no tomatoes! :lol: )

Code: Select all

' Jacques DesRoches (c) Weatherbyyou.com 2013
' Script to run a webpage, like a Cron job on Linux system
' Only provide URL you want to be executed
' Launch with command: cscript.exe "C:\MyPath\LaunchPage.vbs"
Option Explicit
Dim objIEA
Set objIEA = CreateObject("InternetExplorer.Application")
objIEA.Navigate "http://weatherbyyou.com//ss_nature.php"
objIEA.visible = true
While objIEA.Busy
Wend
objIEA.Quit
Set objIEA = Nothing
Copy these line to your favorite editor and name it LaunchPage.vbs
Simply change link http://weatherbyyou.com//ss_nature.php, for yours.

That way, we just have to invoke it with one line:
cscript.exe "C:\MyPath\LaunchPage.vbs"

This could be used at DOS Prompt to see (Very briefly!) that things works
When verified, you could use it in plain "Windows Task Scheduler" to mimic
a "Cron job" if your provider don't support Cron (or just mixed with these stars
command: "5 * * * * myApp") .... or use in Cumulus:

Program: cscript.exe
params: C:\MyPath\LaunchPage.vbs

Then, I'll include it in current "Smokey Bear" project
(eliminate need to use 3rd party live program to produce Fire Indexes)
... but for now if someone would play with it!

Regards,
Jacques