Skip Menu |
 

This queue is for tickets about the Finance-Currency-Convert-XE CPAN distribution.

Report information
The Basics
Id: 78433
Status: open
Priority: 0/
Queue: Finance-Currency-Convert-XE

People
Owner: Nobody in particular
Requestors: michael [...] thismetalsky.org
Cc:
AdminCc:

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



Subject: bug: XE changed their site
Date: Tue, 17 Jul 2012 14:03:00 -0400
To: bug-Finance-Currency-Convert-XE [...] rt.cpan.org
From: Michael <michael [...] thismetalsky.org>
Download (untitled) / with headers
text/plain 320b
I noticed recently that xe.com changed their site. This patch to your XE.pm (assuming 0.20) works for me. -- Michael Stella | IT Systems Architect | http://www.michaelstella.com/ PGP: 1024D/BC3FF6D4 2BC2 A79B 88D1 218A B32B ED7A 2EC2 1206 BC3F F6D4 .tcA thgirypoC muinnelliM latigiD eht detaloiv tsuj evah uoY
Download xe.diff
text/x-diff 1.4k

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #78433] AutoReply: bug: XE changed their site
Date: Tue, 17 Jul 2012 14:12:46 -0400
To: Bugs in Finance-Currency-Convert-XE via RT <bug-Finance-Currency-Convert-XE [...] rt.cpan.org>
From: Michael <michael [...] thismetalsky.org>
Download (untitled) / with headers
text/plain 1.5k
Right, so here's the patch, since this automated email thing didn't work. --- lib/Finance/Currency/Convert/XE.pm 2012-06-19 09:50:00.000000000 -0400 +++ /usr/lib/perl5/site_perl/5.10.0/Finance/Currency/Convert/XE.pm 2012-07-17 13:58:32.000000000 -0400 @@ -315,22 +315,24 @@ my $tag; my $p = HTML::TokeParser->new(\$html); - # look for the faq link - while(1) { - return unless($tag = $p->get_tag('a')); - last if(defined $tag->[1]{href} && $tag->[1]{href} =~ /faq/); - } - - # jump to the next table - $tag = $p->get_tag('table'); - - # from there look for the target value - while($p->get_token) { - my $text = $p->get_trimmed_text; - - if(my ($value) = $text =~ /([\d\.\,]+) $self->{code}/) { - $value =~ s/,//g; - return sprintf $self->{string}, $value; + # first look for the 'td' element + while (1) { + return unless ($tag = $p->get_tag('td')); + next unless (defined($tag->[1]{'align'}) && ($tag->[1]{'align'} eq 'left')); + # this will probably be the value + my $value = $p->get_trimmed_text; + + # then make sure this has the 'span' with the target + # currency code + my $tag2 = $p->get_tag('span'); + my $cd = $p->get_trimmed_text; + if (defined($tag2) && defined($tag2->[1]{'class'} && $tag2->[1]{class} eq 'uccResCde' +)) { + if ($cd eq $self->{code}) { + # found it, return + $value =~ s/,//g; + return sprintf $self->{string}, $value; + } } }
Download (untitled) / with headers
text/plain 227b
On Tue Jul 17 14:03:11 2012, michael@thismetalsky.org wrote: Show quoted text
> > I noticed recently that xe.com changed their site. This patch to your
XE.pm Show quoted text
> (assuming 0.20) works for me.
Thank you! I have patched it and released as 0.21.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.