Anyone Interested in a City Temperature App ?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Velvet Jones
Posts: 4
Joined: Tue Apr 16, 2002 1:00 pm

Anyone Interested in a City Temperature App ?

Post by Velvet Jones »

Win32 platform. Console app that fetches the current temperature from a zipcode or city name you put on the command line. I set it up to only output the value, so it looks very boring, but for Cacti/RRD use, it keeps one from needing to do any parsing.

Velvet Jones
ttyler
Posts: 4
Joined: Mon May 06, 2002 10:41 am
Location: Palm Bay, FL.

Post by ttyler »

Here is a trivial perl script that I use. Requires Geo::Weather from http://freshmeat.net/projects/geoweather/?topic_id=96. This is weather.com data.

#!/usr/bin/perl

use Geo::Weather;

$zipcode = $ARGV[0];

my $weather = new Geo::Weather;
$weather->{timeout} = 5; # set timeout to 5 seconds instead of the default of 10

my $current = $weather->get_weather($zipcode);

# Temperature, Heat Index, Barometric Pressure, Relative Humidity, Dewpoint
print "$current->{temp} $current->{heat} $current->{baro} $current->{humi} $current->{dewp}";

tim
ross
Posts: 16
Joined: Sun Mar 17, 2002 7:00 pm

Post by ross »

or you can just use lynx and parse the data very easly...
no need to load external modules...

check out the FreeBSD script on this site.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests