Weather Check

If you have a linux OS the bash shell script below will tell you most recent temp, windspeed, direction, and rainfall at Everton, Sandy, and Biggleswade from local weather stations using weatherunderground. I crontab it, piping the results to mail -s ‘Current weather’


function checkComponent() {

       curl -s $aurl | tail -3 | tr '\n' ',' | awk -F, ' { print "NAME@ " (5/9)*($2-32) "C dp " (5/9)*($3-32) "C " $5 "@" $8 "mph " $92 "CurrentRain " $10 "in DailyRain " $13 "in\n" } ' | sed "s:NAME:${name}:" >> tempweather

checkComponent IENGLAND82 Everton
checkComponent IBEDSBIG1 Biggles
checkComponent I90580822 Sandy

cat tempweather
rm tempweather

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s