写了一个生成天气预报网页的脚本,很烂,大家拍砖

写了一个生成天气预报网页的脚本,很烂,大家拍砖

从网站获取网页,然后生成一个网页,我把它放在桌面上,挺方便.
复制内容到剪贴板
代码:
#! /bin/bash
while [ 1 ]
do

rm result.bak.htm
wget -O sz http://219.239.44.63/netcenter_news/qxyb/city/index.php?city=%C9%EE%DB%DA&province=%B9%E3%B6%AB&area=%D6%D0%C4%CF
sleep 60
echo 深圳未来天气预报>>result.bak.htm
grep -A 40 未来天气预报 sz>>result.bak.htm

echo "<br>">>result.bak.htm
wget -O cc http://219.239.44.63/netcenter_news/qxyb/city/index.php?city=%B3%A4%B4%BA&province=%BC%AA%C1%D6&area=%B6%AB%B1%B1
sleep 60
echo 长春未来天气预报>>result.bak.htm
grep -A 40 未来天气预报 cc>>result.bak.htm

echo "<br>">>result.bak.htm
wget -O wh http://219.239.44.63/netcenter_news/qxyb/city/index.php?city=%CD%FE%BA%A3&province=%C9%BD%B6%AB&area=%BB%AA%B6%AB
sleep 60
echo 威海未来天气预报>>result.bak.htm
grep -A 40 未来天气预报 wh>>result.bak.htm

if [ -f "result.bak.htm" ]
then
rm -f result.htm
mv result.bak.htm Weather.htm
else
echo "Can't generate result file."
fi

sleep 7200

done
      
直接连到http://219.239.44.63/netcenter_n ... p;area=%BB%AA%B6%AB
用GET命令
然后分析不是更好。      
嗯嗯.....      
高手!高手高高手!      
shell还可以这么用!