Advertisement
okubax

weather script for conky

Apr 18th, 2013
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #!/bin/sh
  2. #AccuWeather (r) RSS weather tool for conky
  3. #
  4. #USAGE: weather.sh <locationcode>
  5. # e.g for London ${execi 300 /home/ajibola/scripts/weather.sh "EUR|UK|UK241|LONDON"}
  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