weather script

David J Patrick davidjpatrick-rieW9WUcm8FFJ04o6PK0Fg at public.gmane.org
Thu Sep 16 22:31:04 UTC 2004


On Thu, 2004-09-16 at 14:52, Lennart Sorensen wrote:
> On Thu, Sep 16, 2004 at 02:31:05PM -0400, David J Patrick wrote:
> > One of these TLUG meetings, we should carry you around on our shoulders,
> > for a bit !
> 
> I would have to make it to one first. :)
See! You'e missing more than lively penguin chatter !
>   Something about heading
> downtown and such.
You GOTTA get out more !
> 
> Here is one from 'man Weather::Underground'
> 
> use Weather::Underground;

so I cut from here ->
> 
> $weather = Weather::Underground->new(
>     place => "Toronto, Ontario",
>     debug => 0,
>     )
>     || die "Error, could not create new weather object: $@\n"
> ;
> 
> $arrayref = $weather->get_weather()
>     || die "Error, calling get_weather() failed: $@\n";
> 
> foreach (@$arrayref) {
>     print "MATCH:\n";
>     while (($key, $value) = each %{$_}) {
>         print "\t$key = $value\n";
>     }
> }
> 
<- to here. save as "weather.whatever.pl", give execute permissions and
run ?
the result ?
[djp at sympatico djp]$ ~/bin/weather.pl
/home/djp/bin/weather.pl: line 1: syntax error near unexpected token `('
/home/djp/bin/weather.pl: line 1: `$weather =
Weather::Underground->new('

hmm ?
I must learn some perl basics (if you'll pardon the mixed reference)
before 

> The less specific the place name, the more matches you get.  So a search
> for just Toronto gets you Toronto Ontario, Toronto South Dakota, etc.
> Pretty neat that way really.  If you give it something that it can't
> match, well then you get a blank result (no errors).
> 
> Maybe this is a start at least.

I'll keep trying stuff, 
this is a non-interactive script, right ?
djp

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list