Skip to content

Instantly share code, notes, and snippets.

@kurosuke
Created June 12, 2012 01:40
Show Gist options
  • Save kurosuke/2913885 to your computer and use it in GitHub Desktop.
Save kurosuke/2913885 to your computer and use it in GitHub Desktop.
get Tokyo weather text file
#!/bin/sh
#
# yahoo weather
#
# weather text
TEXT_INFO=`curl --silent "http://xml.weather.yahoo.com/forecastrss?p=JAXX0085&u=c" | grep yweather:conditio `
TEXT=`echo $TEXT_INFO | sed -e 's/.*text="//' -e 's/".*//'`
TEMP=`echo $TEXT_INFO | sed -e 's/.*temp="//' -e 's/".*//'`
TEMP=`expr $TEMP - 50`
DATE=`echo $TEXT_INFO | sed -e 's/.*date="//' -e 's/".*//'`
#echo $TEXT $TEMP "&#176 <BR>" $DATE
echo $TEXT ":" $TEMP "C"
echo $DATE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment