Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: g_ml2000-x [...] yahoo.de
Cc:
AdminCc:

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



Subject: Again no more rating
The IMDB page layout already changed again, breaking once more the rating field. I fixed it quick'n'dirty (don't know what $val used to hold) like this: --- Film.pm.org 2011-08-09 16:15:32.000000000 +0200 +++ Film.pm 2011-09-21 14:56:06.000000000 +0200 @@ -980,13 +980,13 @@ my $parser = $self->_parser(FORCED); while(my $tag = $parser->get_tag('span')) { - last if $tag->[1]{class} && $tag->[1]{class} eq 'star-bar-user-rate'; + last if $tag->[1]{itemprop} && $tag->[1]{itemprop} eq 'ratingValue'; } - my $text = $parser->get_trimmed_text('/a'); + my $text = $parser->get_trimmed_text('/span'); - my($rating, $val) = $text =~ m!(\d+\.?\d*)/10.*?(\d+,?\d*)!; - $val =~ s/\,// if $val; + my($rating) = $text =~ m!(\d+\.?\d*)!; + my $val =''; $self->{_rating} = [$rating, $val, $self->top_info]; Regards, Peter
From: venom [...] gen-x.co.nz
On Wed Sep 21 09:08:59 2011, g_ml200 wrote: Show quoted text
> The IMDB page layout already changed again, breaking once more the > rating > field. I fixed it quick'n'dirty (don't know what $val used to hold) > like this: > > --- Film.pm.org 2011-08-09 16:15:32.000000000 +0200 > +++ Film.pm 2011-09-21 14:56:06.000000000 +0200 > @@ -980,13 +980,13 @@ > my $parser = $self->_parser(FORCED); > > while(my $tag = $parser->get_tag('span')) { > - last if $tag->[1]{class} && $tag->[1]{class} eq > 'star-bar-user-rate'; > + last if $tag->[1]{itemprop} && > $tag->[1]{itemprop} eq 'ratingValue'; > } > > - my $text = $parser->get_trimmed_text('/a'); > + my $text = $parser->get_trimmed_text('/span'); > > - my($rating, $val) = $text =~ m!(\d+\.?\d*)/10.*?(\d+,?\d*)!; > - $val =~ s/\,// if $val; > + my($rating) = $text =~ m!(\d+\.?\d*)!; > + my $val =''; > > $self->{_rating} = [$rating, $val, $self->top_info]; > > > Regards, > Peter
val was how many many people voted... doing this works for me, gives me both the rating and the ratingCount. my $parser = $self->_parser(FORCED); while(my $tag = $parser->get_tag('span')) { last if $tag->[1]{itemprop} && $tag->[1]{itemprop} eq 'ratingValue'; } my $text = $parser->get_trimmed_text('/span'); my($rating) = $text =~ m!(\d+\.?\d*)!; #my $val =''; while(my $tag = $parser->get_tag('span')) { last if $tag->[1]{itemprop} && $tag->[1]{itemprop} eq 'ratingCount'; } my $val = $parser->get_trimmed_text('/span'); $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; } }
From: 2ge [...] 2ge.us
Just to add my 2 cent, you forget to "clean" $val. Show quoted text
> my $val = $parser->get_trimmed_text('/span');
add here: $val =~ s/\,// if $val; otherwise it is working, thanks!
Subject: Re: [rt.cpan.org #71117] Again no more rating
Date: Wed, 28 Sep 2011 11:59:42 +0300
To: bug-IMDB-Film [...] rt.cpan.org
From: Michael Stepanov <stepanov.michael [...] gmail.com>
Thanks, guys, for suggestions and patches. I'll upload fixed version today. On Wed, Sep 28, 2011 at 5:39 AM, Ing. Branislav Gerzo via RT < bug-IMDB-Film@rt.cpan.org> wrote: Show quoted text
> Queue: IMDB-Film > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=71117 > > > Just to add my 2 cent, you forget to "clean" $val. >
> > my $val = $parser->get_trimmed_text('/span');
> > add here: > $val =~ s/\,// if $val; > > otherwise it is working, thanks! > > > >
-- Best regards, Michael Stepanov http://linuxmce.ru
Subject: Re: [rt.cpan.org #71117] Again no more rating
Date: Wed, 28 Sep 2011 14:33:22 +0300
To: bug-IMDB-Film [...] rt.cpan.org
From: Michael Stepanov <stepanov.michael [...] gmail.com>
New version (0.51) is available on CPAN. On Wed, Sep 28, 2011 at 12:00 PM, Michael Stepanov via RT < bug-IMDB-Film@rt.cpan.org> wrote: Show quoted text
> Queue: IMDB-Film > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=71117 > > > Thanks, guys, for suggestions and patches. I'll upload fixed version today. > > On Wed, Sep 28, 2011 at 5:39 AM, Ing. Branislav Gerzo via RT < > bug-IMDB-Film@rt.cpan.org> wrote: >
> > Queue: IMDB-Film > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=71117 > > > > > Just to add my 2 cent, you forget to "clean" $val. > >
> > > my $val = $parser->get_trimmed_text('/span');
> > > > add here: > > $val =~ s/\,// if $val; > > > > otherwise it is working, thanks! > > > > > > > >
> > > -- > Best regards, > Michael Stepanov > http://linuxmce.ru > >
-- Best regards, Michael Stepanov http://linuxmce.ru