Advertisement
ichase

weather.sh

Oct 16th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/sh
  2. #AccuWeather (r) RSS weather tool for conky
  3. #
  4. #USAGE: weather.sh <locationcode>
  5. #
  6. #(c) Michael Seiler 2007
  7.  
  8. METRIC=0 #Should be 0 or 1; 0 for F, 1 for C
  9.  
  10. if [ -z $1 ]; then
  11. echo
  12. echo "USAGE: weather.sh 23454"
  13. echo
  14. exit 0;
  15. fi
  16.  
  17. curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 \
  18. | sed -n '/Currently:/ s/.*: \(.*\): \([-0-9]*\)\([CF]\).*/\1\ \2°\3/p'
  19.  
  20. #Source = https://bbs.archlinux.org/viewtopic.php?pid=567663#p567663
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement