A.Krishna Chaitanya > Yahoo-Weather-0.04 > Yahoo::Weather

Download:
Yahoo-Weather-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Yahoo::Weather - Perl extension to Find Current Observation WEATHER and Two Day Forecast for a given Location or ZIP CODE.

                - This module also gives you the sugestions based on Location Name or Zip, it gives you GEOGRAPHICAL DETAILS.

SYNOPSIS ^

  use Yahoo::Weather;
 
  $obj=Yahoo::Weather->new();
  
  $obj->getWeatherByLocation($place);

  $obj->getWeatherByLocation($zip);

  $obj->getSugestions($zip);
  
  $obj->getSugestions($loc);

DESCRIPTION ^

Documentation for Yahoo::Weather. This module will get you Weather for 4.5 Million Locations (approx) but one at a time either by ZIPCODE or Place Name.

Create an Object for Yahoo::Weather.

Yahoo::Weather->new();

Get Weather Details Based on Location Name

  $obj->getWeatherByLocation($place);

Get Weather Details Based on Zip Code

  $obj->getWeatherByLocation($zip);

Get Weather Details Based on Location Name in FAH

  $obj->getWeatherByLocation($place,f);

Get Weather Details Based on Zip Code

  $obj->getWeatherByLocation($zip,F);

Default is Cel and if you need it in FARENHEIT only pass 'f' or 'F' as last parameter(second parameter) or else it defaults to Celsius.

getWeatherByLocation function needs either ZIPCODE or PLACENAME as mandate. Second Parameter is Optional. In none specified it defaults to CENTIGRADE.

Get GEOGRAPHICAL Sugestions based Zip Code or Place Name

  $obj->getSugestions($zip);
  $obj->getSugestions($loc);

Above 2 functions gives you GEO Details based on either ZIP or PLACE NAME.

getSugestions function takes only one ARG.

ALL above mentioned methods gives you a HASHREF as return value unless some thing goes wrong.

In case of exceptions, we get following

LOCATION_EMPTY = -1

INVALID_LOCATION = -2

INVALID_ZIP = -2

ZIP_EMPTY = -1

WEATHER_FORECAST_NOT_AVAILABLE = -3

INVALID_KEYWORD = -4 -For Getting Sugestions

SUGESTIONS_NOT_AVAILABLE = -4 For Getting Sugestions

EXPORT

None by default.

SEE ALSO ^

LWP::Simple (http://search.cpan.org/~gaas/libwww-perl-5.837/lib/LWP/Simple.pm)

XML::Simple (http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm)

Please Go through YDN(http://developer.yahoo.com) as it is built using it.

If you can't Find Weather for Particular Location , Please refer to http::/weather.yahoo.com

Weather Data Provider is Weather.com

Weather Data Processor is YAHOO.com

This module needs to be extended further like getting temp of Today only and Forecast of NexDay only etc...When I have time I will defnetly extend it.

Please Note that curently if you give incorrect place name, this module will not give you weather Details or if that particular location(incorrect) is available in YAHOO'S 4.5 million locations it will end up giving those details.

Also this module can't be used more than 1000 times an Hour, As it was the restriction from YDN.

This can be overcome in next Release by adding a method to query the licenced URLS of YDN. This means that you will have to get license your self from YDN(http://developer.yahoo.com) and pass them as parametrs to subroutines.

AUTHOR ^

Krishna Chaitanya Averineni, <krishna_averineni@yahoo.co.in>

COPYRIGHT AND LICENSE ^

Copyright (C) 2010 by Krishna Chaitanya Averineni

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: