Skip Menu |
 

This queue is for tickets about the IMDB-Film CPAN distribution.

Report information
The Basics
Id: 65201
Status: new
Priority: 0/
Queue: IMDB-Film

People
Owner: Nobody in particular
Requestors: ron [...] modelenginenews.org
Cc:
AdminCc:

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



Subject: certification broken by IMDB change?
Download (untitled) / with headers
text/plain 352b
Noticed recently that the certifications() method was no longer returning an array. From the source, it appears that the info gathered must once have been on the retrieved page in a <table>. The current page structure hyperlinks this data. Data on the certificates page are rather complex, so understand if this bug gets a "won't fix" classification.
From: ron [...] modelenginenews.org
Download (untitled) / with headers
text/plain 1.3k
On Thu Jan 27 18:19:32 2011, ron7 wrote: Show quoted text
> Noticed recently that the certifications() method was no longer > returning an array. From the source, it appears that the info
gathered Show quoted text
> must once have been on the retrieved page in a <table>. The current
page Show quoted text
> structure hyperlinks this data. > > Data on the certificates page are rather complex, so understand if
this Show quoted text
> bug gets a "won't fix" classification.
A possible fix (not the best, but works for me): sub certifications { my CLASS_NAME $self = shift; my $forced = shift || 0; my (%cert_list, $tag); my $url = "http://". $self->{host} . "/" . $self->{query} . $self- Show quoted text
>code . "/parentalguide#certification";
my $data = LWP::Simple::get($url); my $parser = new HTML::TokeParser(\$data) or croak "[CRITICAL] Cannot create HTML parser: $!!"; while ($tag = $parser->get_tag('h5')) { my $txt = $parser->get_text; if ($txt =~ /certification/i) { $parser->get_tag('div'); while ($tag = $parser->get_tag()) { last if ($tag->[0] eq 'h3'); if ($tag->[0] eq 'a') { $txt = $parser->get_text; my($country, $range) = split /\:/, $txt; $cert_list{$country} = $range; debug(0,"$country = $range\n"); } } $self->{_certifications} = \%cert_list; } } return $self->{_certifications}; }


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.