weather.sh 442 B

123456789101112131415161718
  1. #/bin/sh
  2. #AccuWeather (r) RSS weather tool for conky
  3. #
  4. #USAGE: weather.sh <locationcode>
  5. #
  6. #(c) Michael Seiler 2007
  7. METRIC=0 #Should be 0 or 1; 0 for F, 1 for C
  8. if [ -z $1 ]; then
  9. echo
  10. echo "USAGE: weather.sh <locationcode>"
  11. echo
  12. exit 0;
  13. fi
  14. curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'