Skip Menu |

This queue is for tickets about the Finance-Bank-LloydsTSB CPAN distribution.

Report information
The Basics
Id: 1992
Status: rejected
Priority: 0/
Queue: Finance-Bank-LloydsTSB

People
Owner: Nobody in particular
Requestors: ganesh-cpanrt [...] earth.li
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.01
Fixed in: (no value)



Subject: full statement support
Generally 2-3 pages of entries are made available by the web interface, but the statement method currently only grabs the most recent. The way the web interface works is a bit bizarre; once you've visited the HTML view of each of the previous pages (in reverse order), the statement.stm link has all the data without needing any parameter changes. This patch adds an option $full parameter to the statement method, which if set causes it to visit the links before grabbing the statement.stm data.
diff -urN Finance-Bank-LloydsTSB-1.01/Changes Finance-Bank-LloydsTSB-1.01gs/Changes --- Finance-Bank-LloydsTSB-1.01/Changes Mon Jun 10 17:33:50 2002 +++ Finance-Bank-LloydsTSB-1.01gs/Changes Mon Jan 27 23:54:10 2003 @@ -1,5 +1,9 @@ Revision history for Perl extension Finance::Bank::LloydsTSB. +1.01gs Mon Jan 27 11:36:17 2003 + - added option "full" parameter to "statement" method to + get all entries + 1.01 Mon Jun 10 17:26:54 2002 - added the "statement" method. diff -urN Finance-Bank-LloydsTSB-1.01/LloydsTSB.pm Finance-Bank-LloydsTSB-1.01gs/LloydsTSB.pm --- Finance-Bank-LloydsTSB-1.01/LloydsTSB.pm Mon Jun 10 17:33:37 2002 +++ Finance-Bank-LloydsTSB-1.01gs/LloydsTSB.pm Mon Jan 27 23:53:18 2003 @@ -1,7 +1,7 @@ package Finance::Bank::LloydsTSB; use strict; use Carp; -our $VERSION = '1.01'; +our $VERSION = '1.01gs'; use LWP::UserAgent; our $ua = LWP::UserAgent->new( env_proxy => 1, @@ -77,11 +77,17 @@ sub statement { my $ac = shift; + my $full = shift || 0; my $code; ($code = $ac->sort_code.$ac->account_no) =~ s/\D//g; my $stm = $Finance::Bank::LloydsTSB::ua->get("https://online.lloydstsb.co.uk/statement.ibc?Account=$code"); + if($full) { + while($stm->content=~m{<a title=\"View your current statement and any previous pages\" href=\"(https://online\.lloydstsb\.co\.uk/statement\.ibc\?Account=\d+\&PageRequired=\d+)\">}) { + $stm=$Finance::Bank::LloydsTSB::ua->get($1); + } + } $stm = $Finance::Bank::LloydsTSB::ua->get("https://online.lloydstsb.co.uk/statment.stm?Account=$code"); - croak unless $stm->is_success; + croak() unless $stm->is_success; return $stm->content; } @@ -127,7 +133,7 @@ sub end() { - my ($self,$tag) = @_; +y my ($self,$tag) = @_; $intable-- if($tag eq 'table'); if($tag eq 'td') { @@ -143,7 +149,6 @@ 1; __END__ -# Below is stub documentation for your module. You better edit it! =head1 NAME @@ -185,10 +190,13 @@ Return the balance as a signed floating point value. - $ac->statement + $ac->statement([$full]) Return a mini-statement as a line-separated list of transactions. -Each transaction is a comma-separated list. B<WARNING>: this interface +Each transaction is a comma-separated list. If $full is set, all +available entries will be returned (there is a performance cost in +doing this). Otherwise, only the most recent page of entries are +returned. B<WARNING>: this interface is currently only useful for display, and hence may change in later versions of this module.
From: ganesh-cpanrt [...] earth.li
[guest - Mon Jan 27 18:44:20 2003]: Show quoted text
> This patch adds an option $full parameter to the statement method, > which if set causes it to visit the links before grabbing the > statement.stm data.
Sorry, the patch is slightly messed up; please use the attached instead. (Or use the original and omit the section @@ -127,7 +133,7 @@ or undo the spurious 'y' at the beginning of the line.)
diff -urN Finance-Bank-LloydsTSB-1.01/Changes Finance-Bank-LloydsTSB-1.01gs/Changes --- Finance-Bank-LloydsTSB-1.01/Changes Mon Jun 10 17:33:50 2002 +++ Finance-Bank-LloydsTSB-1.01gs/Changes Mon Jan 27 23:54:10 2003 @@ -1,5 +1,9 @@ Revision history for Perl extension Finance::Bank::LloydsTSB. +1.01gs Mon Jan 27 11:36:17 2003 + - added option "full" parameter to "statement" method to + get all entries + 1.01 Mon Jun 10 17:26:54 2002 - added the "statement" method. diff -urN Finance-Bank-LloydsTSB-1.01/LloydsTSB.pm Finance-Bank-LloydsTSB-1.01gs/LloydsTSB.pm --- Finance-Bank-LloydsTSB-1.01/LloydsTSB.pm Mon Jun 10 17:33:37 2002 +++ Finance-Bank-LloydsTSB-1.01gs/LloydsTSB.pm Tue Jan 28 00:39:04 2003 @@ -1,7 +1,7 @@ package Finance::Bank::LloydsTSB; use strict; use Carp; -our $VERSION = '1.01'; +our $VERSION = '1.01gs'; use LWP::UserAgent; our $ua = LWP::UserAgent->new( env_proxy => 1, @@ -77,11 +77,17 @@ sub statement { my $ac = shift; + my $full = shift || 0; my $code; ($code = $ac->sort_code.$ac->account_no) =~ s/\D//g; my $stm = $Finance::Bank::LloydsTSB::ua->get("https://online.lloydstsb.co.uk/statement.ibc?Account=$code"); + if($full) { + while($stm->content=~m{<a title=\"View your current statement and any previous pages\" href=\"(https://online\.lloydstsb\.co\.uk/statement\.ibc\?Account=\d+\&PageRequired=\d+)\">}) { + $stm=$Finance::Bank::LloydsTSB::ua->get($1); + } + } $stm = $Finance::Bank::LloydsTSB::ua->get("https://online.lloydstsb.co.uk/statment.stm?Account=$code"); - croak unless $stm->is_success; + croak() unless $stm->is_success; return $stm->content; } @@ -143,7 +149,6 @@ 1; __END__ -# Below is stub documentation for your module. You better edit it! =head1 NAME @@ -185,10 +190,13 @@ Return the balance as a signed floating point value. - $ac->statement + $ac->statement([$full]) Return a mini-statement as a line-separated list of transactions. -Each transaction is a comma-separated list. B<WARNING>: this interface +Each transaction is a comma-separated list. If $full is set, all +available entries will be returned (there is a performance cost in +doing this). Otherwise, only the most recent page of entries are +returned. B<WARNING>: this interface is currently only useful for display, and hence may change in later versions of this module.
From: aspiers [...] cpan.org
On Mon Jan 27 19:25:12 2003, guest wrote: Show quoted text
> [guest - Mon Jan 27 18:44:20 2003]: >
> > This patch adds an option $full parameter to the statement method, > > which if set causes it to visit the links before grabbing the > > statement.stm data.
> > Sorry, the patch is slightly messed up; please use the attached instead. > > (Or use the original and omit the section @@ -127,7 +133,7 @@ or undo > the spurious 'y' at the beginning of the line.)
It is maybe worth noting that I recently uploaded 1.31 which has some initial support for retrieval of transactions within a given time period using the search interface. This is probably a more deterministic method of retrieval than grabbing per statement page, since page boundaries seem to be allocated in a more arbitrary manner (or at least, I haven't spotted the pattern yet, though admittedly I haven't tried to).
From: aspiers [...] cpan.org
On Mon Jan 27 19:25:12 2003, guest wrote: Show quoted text
> [guest - Mon Jan 27 18:44:20 2003]: >
> > This patch adds an option $full parameter to the statement method, > > which if set causes it to visit the links before grabbing the > > statement.stm data.
> > Sorry, the patch is slightly messed up; please use the attached instead. > > (Or use the original and omit the section @@ -127,7 +133,7 @@ or undo > the spurious 'y' at the beginning of the line.)
It is maybe worth noting that I recently uploaded 1.31 which has some initial support for retrieval of transactions within a given time period using the search interface. This is probably a more deterministic method of retrieval than grabbing per statement page, since page boundaries seem to be allocated in a more arbitrary manner (or at least, I haven't spotted the pattern yet, though admittedly I haven't tried to).
Rejected in favour of more recent changes.