ratox-nuggets

useful ratox related scripts
git clone git://git.2f30.org/ratox-nuggets
Log | Files | Refs | LICENSE

rat-weather (405B)


      1 #!/bin/sh
      2 # Weather oracle script
      3 
      4 tail -n0 -f text_out | while read line; do
      5 	address=${line:17:${#line}}     # strip off date time
      6 	curl -s --get --data-urlencode "query=$address" \
      7 		http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml | \
      8 		perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"' | \
      9 		perl -MHTML::Entities -pe 'decode_entities($_);'
     10 done > text_in