#!/bin/sh
read_file() {
echo '
'
echo ' | '
echo 'Title | '
echo 'Price | '
echo 'Buy It Now | '
echo ' | '
echo 'Time Left | '
echo '
'
while IFS= read -r line; do
echo $line | grep 'tr BGCOLOR="#ffffff"' > /dev/null
if [ $? = 0 ]; then
echo $line
while IFS= read -r line2; do
echo $line2 | grep 'space.gif' | grep '/td>' > /dev/null
if [ $? = 0 ]; then
break
else
echo $line2
fi
done
fi
done
}
get_one() {
tmp=`mktemp tmpXXXX`
fetch -q -o $tmp $1
echo '' >> out.html
echo "$1 | " >> out.html
echo '
' >> out.html
read_file < $tmp >> out.html
rm $tmp
}
echo '' > out.html
date >> out.html
echo '' >> out.html
while IFS= read -r line; do
get_one $line
done < watched.txt
echo '' >> out.html