weather script

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
dylix

weather script

Post by dylix »

intially it was a script for mrtg.. now i have modified it for cacti.. yes i know there is "weatherbug" or whatever, but i prefer to use my own stuff :-P

Code: Select all

#!/bin/bash

if [ "$1" = "temp" ]; then
        lynx --dump http://www.wunderground.com/auto/raw/30319 | sed -n '1p' | sed -e 's/|/ /g' | awk '{print $7}'   
fi

if [ "$1" = "wind" ]; then
        lynx --dump http://www.wunderground.com/auto/raw/30319 | sed -n '1p' | sed -e 's/|/ /g' | awk '{print $8}'
fi

if [ "$1" = "humidity" ]; then
        lynx --dump http://www.wunderground.com/auto/raw/30319 | sed -n '1p' | sed -e 's/|/ /g' | awk '{print $10}' | sed -e 's/%//g'
fi

if [ "$1" = "dewpoint" ]; then
        lynx --dump http://www.wunderground.com/auto/raw/30319 | sed -n '1p' | sed -e 's/|/ /g' | awk '{print $11}'
fi
[/code]
dylix
Posts: 1
Joined: Tue Feb 18, 2003 6:19 am
Location: Atlanta, GA
Contact:

Post by dylix »

tserreyn
Posts: 3
Joined: Tue Feb 18, 2003 10:50 am

interesting script but....

Post by tserreyn »

It doesn't seem to work most of the time, I keep getting database errors on the dump file. Also it would be nice to know that you need to set the zip or the city.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest