Advertisement
cirrus

weather.sh

Mar 5th, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.44 KB | None | 0 0
  1. #!/bin/sh
  2. #~/weather.sh
  3. #AccuWeather (r) RSS weather tool for conky
  4. #
  5. #USAGE: weather.sh UKXX0062
  6. #
  7. #(c) Michael Seiler 2007
  8.  
  9. METRIC=1 #Should be 0 or 1; 0 for F, 1 for C
  10.  
  11. if [ -z $1 ]; then
  12. echo
  13. echo "USAGE: weather.sh <locationcode>"
  14. echo
  15. exit 0;
  16. fi
  17.  
  18. curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement