Anyone able to recommend a good book for Expect? Or perhaps a better method
of accomplishing the sequence below (and books on learning that method)?



What I'm trying to automate is a specific sequence of events like this:

An event is triggered on box1. Box1 in turn runs a script (exepct or other)
that will call a specific web page, update information on that page, exit
and open a text file in an editor (nano used in the example below, but any
editor will be okay), change values in that file, save and exit, rebuild an
index for that file used by a separate program, and then log out.



The session would resemble something like this (assuming the script call is
event.expect <param1> <param2>):

elinks www.mydomain.tld

  click on link 1

  click on link 4

  enter username and password to login to the site correctly

  click on link 2

  change field 2 value to <param1>

  change field 4 value to <param2>

  click submit

  click link3

  exit elinks

nano /var/special/basefile.txt

  change field 2 on line 3 to <param1>

  change field 2 on line 4 to <param1>

  change field 2 on line 6 to <param1>

  change field 2 on line 7 to <param2>

  change field 3 on line 9 to <param2>

  [save and exit]

newindex basefile.txt basefile.index

logout



I'm not particularly attached to elinks or nano, but that was the easiest
way (combined with expect/autoexpect) I could think of to automate this
sequence. If there's a better/easier way using another program, I'm all
ears. Just don't say I should use wget or curl because they don't handle
POSTs very well and this will be a POST site that is being connected to.
And, last I looked, curl and wget could only handle generic http auth (i.e.
.htpasswd logins), not any kind of custom login sequence. That won't be the
case here.



Either way, recommendations on the method and a book to learn this method
are most welcome.



Thanks all!
--- Dan

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to