Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

weather::com::dayforecast(3pm) [debian man page]

Weather::Com::DayForecast(3pm)				User Contributed Perl Documentation			    Weather::Com::DayForecast(3pm)

NAME
Weather::Com::DayForecast - class representing a forecast for one day SYNOPSIS
[...] my @locations = $weather_finder->find('Heidelberg'); my $forecast = $locations[0]->forecast(); my $tomorrow = $forecast->day(1); print "Forecast for tomorrow: "; print " - tomorrow it's the ", $tomorrow->date()->date(), " "; print " - sunrise will be at ", $tomorrow->sunrise()->time(), " "; print " - maximum temperature will be ", $tomorrow->high(), " "; DESCRIPTION
Via Weather::Com::DayForecast objects one can access the weather forecast for one specific day. This class will not be updated automatically with each call to one of its methods. You need to call a method of your Weather::Com::Forecast object to get updated objects. CONSTRUCTOR
You usually would not construct an object of this class yourself. This is implicitely done when you call the "day(number of day)" or the "all()" method of a Weather::Com::Forecast object. METHODS
date() Returns a Weather::Com::DateTime object containing the date the forecast is for. high() Returns the maximum temperature that will be reached at daytime. For day 0 (today), this will be 'N/A' when it's after noon... There is a bug in weather.com's date and time mathematics: If you are asking for a location's forecast day 0 and it's short after midnight, day 0 will be "yesterday" and you'll get both, yesterday's daytime forecast and night forecast! I have not investigated this issue further, yet. If anyone has, please inform me! low() Returns the minimum temperature that will be reached at night. sunrise() Returns a Weather::Com::DateTime object containing the time of sunrise. sunset() Returns a Weather::Com::DateTime object containing the time of sunset. day() Returns a Weather::Com::DayPart object with all data belonging to the daytime. For day 0 (today), this will be "undef" when it's after noon... There is a bug in weather.com's date and time mathematics: If you are asking for a location's forecast day 0 and it's short after midnight, day 0 will be "yesterday" and you'll get both, yesterday's daytime forecast and night forecast! I have not investigated this issue further, yet. If anyone has, please inform me! night() Returns a Weather::Com::DayPart object with all data belonging to the night. AUTHOR
Thomas Schnuecker, <thomas@schnuecker.de> COPYRIGHT AND LICENSE
Copyright (C) 2004-2007 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>)! perl v5.8.8 2007-07-09 Weather::Com::DayForecast(3pm)

Check Out this Related Man Page

Weather::Com::Location(3pm)				User Contributed Perl Documentation			       Weather::Com::Location(3pm)

NAME
Weather::Com::Location - class representing one location and its weather SYNOPSIS
#!/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, ); my $finder = Weather::Com::Finder->new(%weatherargs); # if you want an array of locations: my @locations = $finder->find('Heidelberg'); # or if you prefer an arrayref: my $locations = $finder->find('Heidelberg'); foreach my $location (@locations) { print "Found weather for city: ", $location->name(), " "; print "The city is located at: ", $location->latitude(), "deg N, ", $location->longitude(), "deg E "; print "Local time is ", $location->localtime()->time(), " "; print "Sunrise will be/has been at ", $location->sunrise()->time(), " "; } DESCRIPTION
Using Weather::Com::Location objects is the way to access weather (and some location) information for one specific location (city). You get Weather::Com::Location objects by using a finder object (see Weather::Com::Finder). Weather::Com::Location 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. CONSTRUCTOR
new(hash or hashref) The constructor will usually not be used directly because you get ready to use location objects by using a finder. If you ever want to instantiate location 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. METHODS
id() Returns the location id used to instantiate this location. name() Returns the name of the location as provided by weather.com. current_conditions() Returns a Weather::Com::CurrentConditions object containing the current conditions of the location. The Weather::Com::CurrentConditions object is instantiated with the first call of the "current_conditions()" method. Please refer to Weather::Com::CurrentConditions for further details. forecast() Returns a Weather::Com::Forecast object. Please refer to Weather::Com::Forecast for further details. latitude() Returns the latitude of the location. longitude() Returns the longitude of the location. localtime() Returns a Weather::Com::DateTime object containing the local time of the location. This value is evaluated each time you call this method. We do not use the value returned from weather.com here because it does not make any sence to use a cached value to show the current time. localtime_ampm() This method is deprecated and will be removed with the next release! Returns the local time of the location. The time is returned in the format "hh:mm [AM|PM]". To get a 24 hour format use "localtime" instead. Sample: 10:30 PM sunrise() Returns a Weather::Com::DateTime object containing the time of sunrise. sunrise_ampm() This method is deprecated and will be removed with the next release! Returns the time of sunrise in 12 hour format (see "localtime_ampm()" for details). sunset() Returns a Weather::Com::DateTime object containing the time of sunset. sunset_ampm() This method is deprecated and will be removed with the next release! Returns the time of sunset in 12 hour format (see "localtime_ampm()" for details). timezone() Returns the timezone offset to GMT (without respecting daylight savings time). units() Returns a Weather::Com::Units object. Please refer to Weather::Com::Units for further details. SEE ALSO
See also documentation of Weather::Com, Weather::Com::CurrentConditions, Weather::Com::Units. AUTHOR
Thomas Schnuecker, <thomas@schnuecker.de> COPYRIGHT AND LICENSE
Copyright (C) 2004-2007 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) perl v5.8.8 2007-07-09 Weather::Com::Location(3pm)
Man Page