??????Linux?е?shell??????????????????????????????????λ??????????
????1??????????????
????????????????????й???????????????????ж???????id?????磬?????101010100???????????????????????????????????id??101170101???????id??????????????????????????????????????????????????
????1.1shell???
????shell??????????£?
#!/bin/sh
weatherDateRoot=http://www.weather.com.cn/data/sk/101170101.html
weatherDataFile=weather.html
wget $weatherDateRoot -O $weatherDataFile > /dev/null 2>&1
sed 's/.*temp":"([0-9]{1??2}).*/1/g' $weatherDataFile
?????????????????????????????????????????????
??????????????????????????ж??δ?????????鷳???????????????????????????????????е?????????????????????
????2?????????????????????
??????????????????????????????????????????????
????http://www.weather.com.cn/data/sk/101170101.html
???????????й??????????????????????е???????????л????????????id?????????????е?id?滻??????е?id????????
????????????????????
????http://www.weather.com.cn/data/cityinfo/101170101.html
??????????й??????????????????????У?????У?????????????????????????????????????
????2.1??????????
???????shell?????
#!/bin/sh
allDataUrl=http://www.weather.com.cn/data/cityinfo/101170101.html
allDataFile=/home/snowsolf/shell/weather/allDay.html
dataUrl=http://www.weather.com.cn/data/sk/101170101.html
dataFile=/home/snowsolf/shell/weather/weather.html
wget $dataUrl -O $dataFile > /dev/null 2>&1
wget $allDataUrl -O $allDataFile > /dev/null 2>&1
????2.2??????
???????crontab?????????????????crontab -e??????????????????????????????????????β????
????*/30 * * * * /home/snowsolf/shell/weather/weather.sh >> /dev/null
???????д????????30?????????λ????????????????crontab??????????????google??baidu??
????2.3???????
????sed 's/.*temp":"([0-9]{1??2}).*/1/g'
????????????????????????????л??????????
????2.4?????????????????
?????????ο?http://www.cnblogs.com/snowsolf/p/3192224.html??????????????????????????????
??????????????????????????