/s);
$self->{data}{accounts} = $self->_process_accountlist($accountlist);
}
sub _process_accountlist{
my ($self, $accountlist) = @_;
my (@accounts, $stream, $token);
$stream = HTML::TokeParser->new(\$accountlist) or croak "$!, stopped";
$stream->get_tag("tr");
while ($token = $stream->get_tag("tr") and exists $token->[1]{class}) {
$token = $stream->get_tag("td");
my $name = $stream->get_trimmed_text("/td");
$stream->get_tag("td"); $stream->get_tag("span");
$name =~ s/\xa0+/ /;
$name =~ s/^\s+//;
$name =~ s/\s+$//;
my $sortcode = $stream->get_trimmed_text("/span");
$stream->get_tag("span");
my $account = $stream->get_trimmed_text("/span");
$stream->get_tag("td");
my $balance = $stream->get_trimmed_text("/td");
$stream->get_tag("td");
$balance =~ s/\xa3//;
$balance =~ s/,//g;
my $available = $stream->get_trimmed_text("/td");
$available =~ s/\xa3//;
$available =~ s/,//g;
push @accounts, {
name => $name,
account => $account,
sortcode => $sortcode,
balance => $balance,
available => $available,
};
}
return \@accounts;
};
1;
__END__
=back
=head1 WARNING
This warning is from Simon Cozens' C
, and seems
just as apt here.
This is code for B, and that means B, and
that means B. You are encouraged, nay, expected, to audit
the source of this module yourself to reassure yourself that I am not
doing anything untoward with your banking data. This software is useful
to me, but is provided under B, explicit or implied.
=head1 NOTES
This has only been tested on my own accounts. I imagine it should work on any
account types, but I can't guarantee this.
=head1 TODO
=over 4
=item B
I still have ministatement, direct debit and standing order functionality to copy
over from my earlier, unreleased version of this code, along with ways of
accessing accounts by name or account/sortcode alongside the list layout.
=item B
=item B
=item B
=item B
=back
=head1 BUGS
There are sure to be some bugs lurking in here somewhere. If you find one, please
report it via RT
=head1 THANKS
Simon Cozens for C. Various members of London.pm for
prodding me occasionally to come back to this and do some more on it.
=head1 AUTHOR
Jody Belka C
=head1 COPYRIGHT AND LICENSE
Copyright 2003 by Jody Belka
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut