#!/bin/sh ### http://www.opentopia.com/sunlightmaprect.html ### http://www.opentopia.com/sunlightmaphemi.html DATESTR=`date "+%Y%m%d%H%M"` BASEDIR="/usr/local/www/data/world_sunlight_map" TEMPDIR="/tmp" ###中央氣象局衛星雲圖 CWBBASEDIR="/usr/local/www/data/CWBV6" CWBDATE=`date +"%Y-%m-%d-%H-%M"` USERAGENT='--user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"' #下載全球衛星雲圖 /usr/local/bin/wget -q -O /usr/local/www/data/world_sunlight_map_ori.jpg http://www.opentopia.com/images/data/sunlight/world_sunlight_map_rectangular.jpg /bin/rm -f /usr/local/www/data/world_sunlight_map_rectangular.jpg /bin/mv /usr/local/www/data/world_sunlight_map_ori.jpg /usr/local/www/data/world_sunlight_map_rectangular.jpg /bin/cp /usr/local/www/data/world_sunlight_map_rectangular.jpg ${BASEDIR}/world_sunlight_map_rectangular_${DATESTR}.jpg /bin/cp /usr/local/www/data/world_sunlight_map_rectangular.jpg ${TEMPDIR}/original.jpg #切割、合併圖片, 讓東亞在地圖中間 /usr/local/bin/convert ${TEMPDIR}/original.jpg -crop 600x887+0+0 ${TEMPDIR}/left.jpg /usr/local/bin/convert ${TEMPDIR}/original.jpg -crop 1600x887+600+0 ${TEMPDIR}/right.jpg /usr/local/bin/convert ${TEMPDIR}/right.jpg ${TEMPDIR}/left.jpg +append ${BASEDIR}/TW/world_sunlight_map.jpg /bin/cp ${BASEDIR}/TW/world_sunlight_map.jpg ${BASEDIR}/TW/world_sunlight_map/world_sunlight_map_${DATESTR}.jpg /bin/rm -f ${TEMPDIR}/original.jpg ${TEMPDIR}/left.jpg ${TEMPDIR}/right.jp sleep 10 ###中央氣象局衛星雲圖 # MTSAT 紅外線雲圖 /usr/local/bin/wget -q ${USERAGENT} -O ${CWBBASEDIR}/HS1P/HS1P-${CWBDATE}.jpg http://www.cwb.gov.tw/V6/observe/satellite/Data/HS1P/HS1P-${CWBDATE}.jpg sleep 10 # MTSAT 紅外線 色調強化 /usr/local/bin/wget -q ${USERAGENT} -O ${CWBBASEDIR}/HS1Q/HS1Q-${CWBDATE}.jpg http://www.cwb.gov.tw/V6/observe/satellite/Data/HS1Q/HS1Q-${CWBDATE}.jpg sleep 10 # MTSAT 紅色線 黑白 /usr/local/bin/wget -q ${USERAGENT} -O ${CWBBASEDIR}/HS1O/HS1O-${CWBDATE}.jpg http://www.cwb.gov.tw/V6/observe/satellite/Data/HS1O/HS1O-${CWBDATE}.jpg sleep 10 # MTSAT 可見光 /usr/local/bin/wget -q ${USERAGENT} -O ${CWBBASEDIR}/HSAO/HSAO-${CWBDATE}.jpg http://www.cwb.gov.tw/V6/observe/satellite/Data/HSAO/HSAO-${CWBDATE}.jpg # Remove empty file find ${CWBBASEDIR}/ -type f -size 0 | xargs rm -f
2. 在 crontab 加上(不用太常連線抓檔)
30 */2 * * * root /PATH/TO/get_world_sunlight_map.sh
3. 想要在 Windows XP 換桌面可以改用 Desktop Earth.
No comments:
Post a Comment