I was wondering if anyone could help me with adding on to this simple script I am using. I'm running it in Cygwin Bash shell on Windows XP.
Code:
while : ; do
if lynx -dump http://URLhere.com |grep "\]0 [0-5]" ; then
sndrec32.exe /play /embedding "C:\1alarm.wav" &
sleep 11s
fi
date
done
This script obviously searches for a certain pattern of numbers on a web page and then activates a sound followed by an 11 second sleep if the numbers were present on the web page. The first number being searched must be 0 and is always a link, which is identified by the \] before the 0. Anyway, I want the script to be able to then figure out what link is three links BEFORE the number 0 and launch the URL of that link in a web browser of my choice.
For example - If it finds the pattern with 0 being link number 29 on the page, then I want link number 26's URL to be launched. I'm not an expert at this so I'm having trouble figuring out if this would be possible, but I have a strong feeling that it can be done and it's probably fairly simple to do.
Any answers would be a huge help. Thanks for taking the time to listen to my request.
