package Finance::QuoteTW::Allianz;
use Spiffy -Base;
use WWW::Mechanize;
use HTML::TableExtract;
use Encode qw/from_to/;
use Encode::TW;
use HTML::Encoding 'encoding_from_http_message';
use Data::TreeDumper;

#  Variables

use version; our $VERSION = qv('0.02');

#  Methods

sub fetch {
	my $b = WWW::Mechanize->new;
	my $response = $b->get('');
	my $current_encoding = encoding_from_http_message($response);
	my @result;

	my $te = HTML::TableExtract->new;
    my @ts = $te->tables;
    my @rows = $ts[16]->rows;
    shift @rows;

	foreach my $row (@rows) {
		my @data = @{$row};
        my ($nav, $date) = $data[12] =~ /(\d+\.\d+)\(([^)]+)/;
		from_to($data[3], $current_encoding, $self->{encoding});

		push @result, {
			name     => $data[3],
			date     => $date,
			nav      => $nav,
			change   => 'N/A',
			currency => $data[9],
			type     => 'N/A',

	return @result;


=head1 NAME 

Finance::QuoteTW::Allianz - Get fund quotes from


See L<Finance::QuoteTW>.


Get fund quotes from


=head2 fetch

see L<Finance::QuoteTW>

=head1 AUTHOR

Alec Chen <>


Copyright (C) 2007 by Alec Chen. All rights reserved.

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.