g***f 发帖数: 18 | 1 #!/bin/sh
#
#
# current web page for HP TouchPad Wi-Fi 16GB
webpage="http://www.shopping.hp.com/product/rts_tablet/rts_tablet/1/storefronts/FB355UA%2523ABA"
# check this string on the web page
mystr="Coming soon"
# email you when mystr disappears
# change this to your email address
myemail="a*[email protected]"
mysubj="HP Touchpad might be vailable Now!"
# sleep this amount of seconds before reshua
mysleep=30
while [ 1 ]
do
lynx -dump "$webpage" | grep "$mystr" > /dev/null
if [ $? -ne 0 ] ; then
# ring some bells
echo -e -n '\a'; sleep 1; echo -e -n '\a'; sleep 1; echo -e -n '\a'
echo "***** $mysubj *****"
# email you
echo "$webpage" | mail -s "$mysubj" "$myemail"
exit 0
fi
sleep $mysleep
done |
s******b 发帖数: 653 | 2 有货以后显示"HP Touchpad Available Now"吗? |
g***f 发帖数: 18 | 3 Note:
Depending on your system mail settings, the notification email might be filtered as spam by your email client, as the incoming email address
might be from domains like "localhost". So check your spam folder.
What I would suggest is, first run the script with "Coming soon" changed to something else, then you will get an email notification from your system, if the email is in spam folder, click "Not Spam". Now change mystr back to "Coming soon", and run the script again. |
g***f 发帖数: 18 | 4 Likely but not certainly. This only checks for the disappearance of "Coming soon" on the web page... When that happens, your system will email you.
【在 s******b 的大作中提到】 : 有货以后显示"HP Touchpad Available Now"吗?
|
b******k 发帖数: 244 | 5 多谢lz
为什么我运行,说 lynx:command not found |
g***f 发帖数: 18 | 6 try /usr/bin/lynx
if you don't have lynx, try other text browsers, such as links (replace lynx with it in the script). you can look up text browsers on your system by:
man -k browser
or you can just "yum install lynx" or "apt-get install lynx"
【在 b******k 的大作中提到】 : 多谢lz : 为什么我运行,说 lynx:command not found
|
b******k 发帖数: 244 | |
b******k 发帖数: 244 | 8 多问一句,送给多个email, 用逗号还是分号分隔啊? |
g***f 发帖数: 18 | 9 逗号 should work, otherwise, "man mail"
【在 b******k 的大作中提到】 : 多问一句,送给多个email, 用逗号还是分号分隔啊?
|
b******k 发帖数: 244 | |
e**********y 发帖数: 128 | 11 nice code!
【在 g***f 的大作中提到】 : #!/bin/sh : # : # : # current web page for HP TouchPad Wi-Fi 16GB : webpage="http://www.shopping.hp.com/product/rts_tablet/rts_tablet/1/storefronts/FB355UA%2523ABA" : # check this string on the web page : mystr="Coming soon" : # email you when mystr disappears : # change this to your email address : myemail="a*[email protected]"
|