Hi Folks!
I am a MacUser and am trying to learn Unix for the last few months.
I will explain in detail what I am trying to do, and apreciate you help if you can teach me even if it is a single comand line inside the script.
I own a small company, where I manufacture special gypsums and plasters for dental use. Outside my office, I have a equipment, a scale, that can weigh pallets from 0 to 3000Kg. This scale is connected to my small network and has its own web server.
If I type on this URL:
http://169.254.79.250/peso.html on any web browser, on any computer, on my small network, a request is sent to the webserver installed on my scale and a page as this is displayed:
example in .html:
Click here for example.
(this example contains a Javascript that will direct you to an error page after a few seconds. You might need to click on the "back" button of your browser)
example of the source code in pdf:
click here for example in pdf
One can notice inside the code where it is written "0,0Kg". This is the variable. As one of my employees places a new pallet with a diferent new weight this value changes.
OK!
This is what I want to do:
I want to write a script to run on the Macs's Unix terminal and do this:
1) Capture the html source code on
http://169.254.79.250/peso.html (this is a reference in my small network)
2) Identify the variable inside the code, let's say each 10 seconds. (the value just before Kg)
3) Use a logical function to determine if the value has changed, and if it did change , write a line in a text file. (pesolog.txt)
Example of pesolog.txt:
O January 2nd 2004 at 12:45 peso has changed to 1254Kg
On January 2nd 2004 at 13:15 peso has changed to 1869kg
etc...
I thank you for your help, even if it is just a single command line.
Greeting from
Bernardo Höhl
Rio de Janeiro - Brazil
PS: This site is so CPU intensive on my Mac. My computer runs very, very slow when I have this page running.. Do you experience the same problem?