Weather::Com::CurrentConditions - class containing current weather conditions
#!/usr/bin/perl -w use Weather::Com::Finder; # you have to fill in your ids from weather.com here my $PartnerId = 'somepartnerid'; my $LicenseKey = 'mylicense'; my %weatherargs = ( 'partner_id' => $PartnerId, 'license' => $LicenseKey, 'language' => 'de', ); my $finder = Weather::Com::Finder->new(%weatherargs); # if you want an array of locations: my @locations = $finder->find('Heidelberg'); my $conditions = $locations->current_conditions(); print "Found weather for city: ", $location->name(), "\n"; print "Current conditions are ", $conditions->description(), "\n"; print "Current temperature is ", $conditions->temperature(), "°C\n"; print "... as found out by observatory ", $conditions->observatory(), "\n";
Using Weather::Com::CurrentCondition objects provide current weather conditions of its parent object (a location) to you.
You get Weather::Com::CurrentConditions objects by calling the method
current_conditions() of your location object.
Weather::Com::CurrentConditions is a subclass of Weather::Com::Cached. An instance of this class will update itself corresponding to the caching rules any time one of its methods is called.
The constructor will usually not be used directly because you get a ready to use current conditions objects from your location object.
If you ever want to instantiate current conditions objects on your own, you have to provide the same configuration hash or hashref to the constructor you usually would provide to the
new() method of Weather::Com::Finder. In addition it is necessary to add a hash element
location_id to this config hash. The
location_id has to be a valid weather.com location id.
Returns the location id used to instantiate this object.
Returns the name of the location this current conditions belong to.
Returns a textual representation of the current weather conditions.
This description is translated if you specified the language option as argument for your Weather::Com::Finder.
This attribute is dynamic language enabled.
Returns the dewpoint.
Returns the humidity (in %).
Returns the number of the icon that can be used to display the current weather conditions. These icons are available with the weather.com sdk. You can download this sdk from weather.com after you've registered to get your license.
Returns a Weather::Com::DateTime object containing the date and time of the last update as provided by weather.com.
Returns the name of the observatory that provided the current conditions to weather.com.
Returns a Weather::Com::AirPressure object.
Please refer to Weather::Com::AirPressure for further details.
Returns the temperature (depending on how you instantiated your Weather::Com::Finder you'll get centigrade (default) or degrees fahrenheit).
Returns a Weather::Com::UVIndex object.
Please refer to Weather::Com::UVIndex for further details.
Returns the visibility (depending on how you instantiated your Weather::Com::Finder you'll get km (default) or miles).
Returns a Weather::Com::Wind object.
Please refer to Weather::Com::Wind for further details.
Returns the windchill temperature (depending on how you instantiated your Weather::Com::Finder you'll get centigrade (default) or degrees fahrenheit).
Thomas Schnuecker, <email@example.com>
Copyright (C) 2004-2009 by Thomas Schnuecker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The data provided by weather.com and made accessible by this OO interface can be used for free under special terms. Please have a look at the application programming guide of weather.com (http://www.weather.com/services/xmloap.html)