NAME

Weather::TW - Fetch Taiwan weather data from 中央氣象局

SYNOPSIS

use Weather::TW;
my $weather = new Weather::TW;
my $xml = $weather->area('Taipei')->xml;
# currently only xml is supported

foreach my $area ($weather->area_en){
  my $xml = $weather->area($area)->xml
  print $xml;
}

use utf8;
$xml = $weather->area('�北市')->xml;
# Chinese also works!

DESCRIPTION

This module parse data from http://www.cwb.gov.tw/ (中央氣象局), and generates xml data. In future it may support json and other formats as well.

METHODS

<new>

Create a new Weather::TW object.

<area('$area_name')>

City name can be either Chinese or English. The returned value is $self so you can use it for cascading.

$xmlstr = $weather->area('Taipei City')->to_XML;

The available area names are:

�北市       Taipei City
新北市       New Taipei City
�中市       Taichung City
��市       Tainan City
高雄市       Kaohsiung City
基隆北海岸   Keelung North Coast
桃園         Taoyuan
新竹         Hsinchu
è‹—æ —         Miaoli
彰化         Changhua
�投         Nantou
雲林         Yunlin
嘉義         Chiayi
��         Pingtung
�春�島     Hengchun Peninsula
宜蘭         Yilan
花蓮         Hualien
��         Taitung
澎湖         Penghu
金門         Kinmen
馬祖         Matsu
<area_zh>

Return area names in Chinese.

@names = $weather->area_zh;
<area_en>

Return area names in English.

@names = $weather->area_en;
<xml>

Return data as xml

SEE ALSO

https://github.com/dryman/Weather-TW

XML::Smart

AUTHOR

dryman, <idryman@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2011 by dryman

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 70:

Non-ASCII character seen before =encoding in '中央氣象局'. Assuming CP1252