Advertisement
eastpole

FehWeather

Feb 9th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.07 KB | None | 0 0
  1. while true; do
  2.  
  3. #-------------------
  4.    
  5. ltng="http://weather.gc.ca/data/lightning_images/ONT.png"
  6. #-------------------
  7.  
  8. # http://www.weatheroffice.gc.ca/radar/
  9. radar=`\
  10.     wget -q -O- http://www.weatheroffice.gc.ca/radar/index_e.html?id=WKR \
  11.     | grep image.php \
  12.     | head -1 \
  13.     | cut -d"\"" -f 2 \
  14.     `
  15. # need to ditch & and replace with & in string.
  16. # http://tldp.org/LDP/abs/html/string-manipulation.html
  17. # echo ${stringZ//abc/xyz}      # xyzABC123ABCxyz
  18. #  Replaces all matches of 'abc' with # 'xyz'.
  19. radar=`echo ${radar//&/&}`
  20. # echo ${radar//&/&}
  21. radar=http://www.weatheroffice.gc.ca/radar/$radar
  22. #-------------------
  23.  
  24. aqi=http://graphs.eastpole.ca/aqi-today.png
  25. insol=http://graphs.eastpole.ca/insolation-today.png
  26. torwat=http://graphs.eastpole.ca/toronto-water-use.png
  27.  
  28. # -------------------------------------
  29. feh -FZd $radar $ltng $aqi $insol $torwat
  30. # echo $radar $ltng $aqi $insol $torwat
  31.  
  32. # Sleeping here does not do what you think.
  33. # It waits 60 seconds after you quit feh and then recurses.  
  34. # Well that's no good.
  35. #
  36. sleep 60
  37.  
  38. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement