Web Server - Read Command

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
catch22
Newbie
Posts: 2
Joined: Sat Apr 24, 2004 4:01 pm

Web Server - Read Command

Post by catch22 » Sat Apr 24, 2004 4:12 pm

I am looking for the moste efficient way to do this. I admit to being a bit lazy and putting the task here....

I run a webserver and have a page:

http://newyorksecure.com/command.htm

I would like a macro to check that page every minute, read the text, analyze it for any of a number of strings, and execute a macro based on result. Then open that html page locally and replace with "Waiting on Command". That page locally is at D:\server\www\command.htm.

Each check writes to a log text file "No Command" or "Executed XXX". All behind the scenes (nothing visible).

Any help would be appreciated. I am quite new at this, but have a programming mind.




User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Apr 24, 2004 6:15 pm

Here is a quick and dirty structure to start from. Syntax is definitely no good, just trying to get you started. I think this covers most of the steps.
Label>Start
Run Program>Open Browser to web page
Let>RP_WINDOWMODE =0
SavePage locally
ReadLn from saved page, start at line #9 (after the start of "body")
If> line = open pcAnywhere,DoPCA
If> line = open Exel,Excel
If line> = something else,Others
Let>Action=No Command
Goto>Finish

Label>DoPCA
Let>Action=Executed pcAnyWhere
DeleteFile>D:\server\www\command.htm
WriteLn>D:\server\www\command.htm,Waiting On Command
...
...
Goto>Finish

Label>Excel
Let>Action=Executed Excel
DeleteFile>D:\server\www\command.htm
WriteLn>D:\server\www\command.htm,Waiting On Command
...
...
Goto>Finish

Label>Others
DeleteFile>D:\server\www\command.htm
WriteLn>D:\server\www\command.htm,Waiting On Command
Let>Action=Executed Other Actions
...
...
Goto>Finish

Label>Finish
GetDate>Date
TimeStamp>Drive:\path\filename.txt,%Date% -- %Action%
Wait>60
Goto>Start
You probably need to SetFocus to Save Page. Just noted your invisible requirement. May need to resize the browser window so it appears invisible.
Not clear on how you are refreshing page on website, but could use Macro Scheduler FTP to do that.

Sorry if I missed anything, again, just an off the top of my head approach to work from.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Tue May 04, 2004 10:31 pm

Catch22, have you solved this ?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts