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