Skip Menu |

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

Report information
The Basics
Id: 73815
Status: open
Priority: 0/
Queue: IMDB-Film

People
Owner: Nobody in particular
Requestors: vincent.sercu [...] gmail.com
Cc:
AdminCc:

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



Subject: Bug in Film.pm package
Date: Sat, 7 Jan 2012 22:48:20 +0100
To: bug-IMDB-Film [...] rt.cpan.org
From: Vincent Sercu <vincent.sercu [...] gmail.com>
Hi, I've found a small bug in the rating of films and series; I was able to locate and fix it. IMDB must've probably changed their website so the parsing of the following item did not work anymore: Film.pm, starting at line 925 in version 0.51 sub rating { my CLASS_NAME $self = shift; my ($forced) = shift || 0; if($forced) { my $parser = $self->_parser(FORCED); while(my $tag = $parser->get_tag('div')) { * last if $tag->[1]{class} && $tag->[1]{class} eq 'star-box-details';* } my $text = $parser->get_trimmed_text('/a'); my($rating, $val) = $text =~ m!(\d+\.?\d*)/10.*?(\d+,?\d*)!; $val =~ s/\,// if $val; $self->{_rating} = [$rating, $val, $self->top_info]; unless($self->{_plot}) { my $tag = $parser->get_tag('p'); my $text = $parser->get_trimmed_text('/p'); $self->{_plot} = $text; } } if you change the line in bold to last if $tag->[1]{class} && $tag->[1]{class} eq '*star-bar-user-rate*'; It works smoothly again :) Keep up the good work! Cheers, Vincent Sercu Belgium
Hi Vincent, It looks like IMDB reverted back star-box-details :) On Sat Jan 07 16:48:49 2012, vincent.sercu@gmail.com wrote: Show quoted text
> Hi, > > I've found a small bug in the rating of films and series; I was able to > locate and fix it. > IMDB must've probably changed their website so the parsing of the
following Show quoted text
> item did not work anymore: > > Film.pm, starting at line 925 in version 0.51 > > sub rating { > my CLASS_NAME $self = shift; > my ($forced) = shift || 0; > > if($forced) { > my $parser = $self->_parser(FORCED); > > while(my $tag = $parser->get_tag('div')) { > * last if $tag->[1]{class} && $tag->[1]{class} eq > 'star-box-details';* > } > > my $text = $parser->get_trimmed_text('/a'); > > my($rating, $val) = $text =~ m!(\d+\.?\d*)/10.*?(\d+,?\d*)!; > $val =~ s/\,// if $val; > > $self->{_rating} = [$rating, $val, $self->top_info]; > > unless($self->{_plot}) { > my $tag = $parser->get_tag('p'); > my $text = $parser->get_trimmed_text('/p'); > $self->{_plot} = $text; > } > } > > if you change the line in bold to > > last if $tag->[1]{class} && $tag->[1]{class} eq '*star-bar-user-rate*'; > > It works smoothly again :) > > Keep up the good work! > > Cheers, > Vincent Sercu > Belgium
-- Cheers, Michael