ZConf::Weather - A ZConf module for fetching weather information.
Version 1.0.0
use ZConf::Weather; my $zcw = ZConf::Weather->new(); ...
This initializes it.
One arguement is taken and that is a hash value.
If this function errors, it will will be set permanently.
This is the a ZConf object.
my $zcw=ZConf::Weather->new(); if($zcw->{error}){ print "Error!\n"; }
This gets what the default local is set to.
my $local=$zcw->getDefaultLocal; if($zcw->{error}){ print "Error!\n"; }
This gets what the default type is set to.
my $local=$zcw->getDefaultType; if($zcw->{error}){ print "Error!\n"; }
This gets what the current set is.
my $set=$zcw->getSet; if($zbm->{error}){ print "Error!\n"; }
This returns a template as a string.
my $template=$zcw->getTemplate('some/template'); if ($zcw->{error}) { print "Error!\n"; }
Returns the arrayref from Weather::Underground->get_weather.
The only arguement required is the name of the local.
$aref=$zcw->getWeather('someLocal'); if($zcw->{error}){ print "Error!\n"; }
This fetches the Weather::Underground object.
The only arguement accepted is the name of the local.
my $wu=$zcw->getWeatherObj('someLocal'); if($zcw->{error}){ print "Error!"; }
This initializes it or a new set.
If the specified set already exists, it will be reset.
One arguement is required and it is the name of the set. If it is not defined, ZConf will use the default one.
#creates a new set named foo $zcw->init('foo'); if($zcw->{error}){ print "Error!\n"; } #creates a new set with ZConf choosing it's name $zcw->init(); if($zcw->{error}){ print "Error!\n"; }
This gets a list of available locals.
my @locals=$zcw->listLocals; if($zcw->{error}){ print "Error!\n"; }
This lists the available sets.
my @sets=$zcw->listSets; if($zcw->{error}){ print "Error!"; }
This gets a list of available templates.
my @templates=$zcw->listTemplates; if($zcw->{error}){ print "Error!\n"; }
This makes sure a specified local exists.
my $returned=$zcw->localExists('somelocal'); if($zcw->{error}){ print "Error!\n"; }else{ if($returned){ print "It exists.\n"; } }
This reads a specific set. If the set specified is undef, the default set is read.
#read the default set $zcw->readSet(); if($zcr->{error}){ print "Error!\n"; } #read the set 'someSet' $zcw->readSet('someSet'); if($zcr->{error}){ print "Error!\n"; }
This acts on a local using it's defined type.
$zcw->run('someLocal'); if($zcw->{error}){ print "Error!\n"; }
This sets a local. If it does not exist, it will be created. An already existing one will be overwriten.
This is the local it is for.
This is name that will be used differentiating between the various locals setup. It needs to be a valid ZConf set name.
This is what to do with it after downloading it.
The template to use if 'type' is set to 'template'.
This sets a specified template to the given value.
$zcw->setTemplate($templateName, $template); if ($zcw->{error}) { print "Error!\n"; }
This makes sure a specified template exists.
my $returned=$zcw->templateExists('someTemplate'); if($zcw->{error}){ print "Error!\n"; }else{ if($returned){ print "It exists.\n"; } }
This blanks the error storage and is only meant for internal usage.
It does the following.
$self->{error}=undef; $self->{errorString}="";
Could not initialize ZConf.
ZConf error.
No local defined.
Invalid set name.
No type specified.
No template name specified.
Non-existant template.
Invalid type specified.
No template specified.
Local does not exist.
Failed to init the module Weather::Underground.
Failed to fetch the weather.
Template does not exist.
The type is not valid.
No default local specified.
getDefaultLocal errors and no local is specified.
No default type specified.
This is the default local to act upon if not specified.
This is the default thing to do.
This is the default template name to use.
This is the location it is for. It can be specified as 'City', 'City, State', 'State', 'State, Country', or 'Country'.
This specifies what should be done when fetching it.
Prints it in 'variable=value' format.
This prints it using the specied template name. The template name being 'templates/<name>'.
This is a template. For please see the section TEMPLATE for more information on the keys and etc.
'*' can be any zconf compatible var name.
Zane C. Bowers, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-zconf-weather at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ZConf-Weather. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-zconf-weather at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc ZConf::Weather
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=ZConf-Weather
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/ZConf-Weather
CPAN Ratings
http://cpanratings.perl.org/d/ZConf-Weather
Search CPAN
http://search.cpan.org/dist/ZConf-Weather
Copyright 2009 Zane C. Bowers, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install ZConf::Weather, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ZConf::Weather
CPAN shell
perl -MCPAN -e shell install ZConf::Weather
For more information on module installation, please visit the detailed CPAN module installation guide.