Skip to content

Instantly share code, notes, and snippets.

@myles
Created January 2, 2010 22:26
Show Gist options
  • Save myles/267702 to your computer and use it in GitHub Desktop.
Save myles/267702 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Get weather image
# Add this to your crontab.
YAHOO_WEATHER_HTML=`curl --silent "http://weather.yahoo.com/canada/ontario/toron
to-4118/?unit=c"`
curl --silent -o /tmp/weather.html "http://weather.yahoo.com/canada/ontario/toro
nto-4118/?unit=c"
if [[ $YAHOO_WEATHER_HTML ]]; then
curl --silent -o /tmp/weather.png $(grep 'div class="forecast-icon" styl
e="background:url' /tmp/weather.html | awk -F"'" '{ printf $2 }')
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment