Skip to content

Instantly share code, notes, and snippets.

@ehamberg
Created January 11, 2011 15:26
Show Gist options
  • Save ehamberg/774553 to your computer and use it in GitHub Desktop.
Save ehamberg/774553 to your computer and use it in GitHub Desktop.
temperature for trondheim
#!/bin/bash
URL=http://www.yr.no/sted/Norge/Sør-Trøndelag/Trondheim/Trondheim/varsel.xml
TEMP=$(wget -q -O - $URL | awk -F\" '/<temperature/ {print $4;exit}')
if [ $TEMP -gt "20" ]; then
echo "<fc=#ee4444>${TEMP}</fc>"
elif [ $TEMP -lt "0" ]; then
echo "<fc=#3bb9ff>${TEMP}</fc>"
else
echo "${TEMP}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment