Skip Menu |

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

Report information
The Basics
Id: 25129
Status: resolved
Priority: 0/
Queue: IMDB-Film

People
Owner: Nobody in particular
Requestors: u.tueshaus [...] gmail.com
Cc:
AdminCc:

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



CC: bug-IMDB-Film [...] rt.cpan.org
Subject: IMDB-Film-0.24: film ratings are not available
Date: Sat, 24 Feb 2007 19:38:17 +0100
To: stepanov.michael [...] gmail.com
From: "Ulrich Tueshaus" <u.tueshaus [...] gmail.com>
Dear Michael, as I am no specialist in filing bugs, please excuse me for sending this report directly to you. Because of the redesign of the IMDB web pages, I installed IMDB-Film-0.24. Now, the retrieval of most of the IMDB information (i.e. year, countries, title, directors, plot) is working fine as before, only the rating information is still not available. As the script itself was working with the earlier version IMDB-Film, I assume that the problem has to do with the new IMDB page design. (Or has the interface to the information ( $rating = $imdbObj->rating(); ) changed?) If you need more information I will try to provide it. Best regards, Ulrich Show quoted text
> This is perl, v5.8.8 built for MSWin32-x86-multi-thread > (with 33 registered patches, see perl -V for more detail) > > Copyright 1987-2006, Larry Wall > > Binary build 819 [267479] provided by ActiveState http://www.ActiveState.com > Built Aug 29 2006 12:42:41
From: swp5jhu02 [...] sneakemail.com
Here is a patch against 0.24 that works for me: ratings.patch
Index: IMDB/Film.pm =================================================================== --- IMDB/Film.pm (revision 1177) +++ IMDB/Film.pm (working copy) @@ -580,14 +580,16 @@ if($forced) { my $parser = $self->_parser(FORCED); - while(my $tag = $parser->get_tag(MAIN_TAG)) { - last if $parser->get_text =~ /rating/i; + while (my $tag = $parser->get_tag("div")) { + my $attr = $tag->[1]; + last if $attr->{id} && $attr->{id} =~ /rating/i; } my $tag = $parser->get_tag('b'); - my $text = $parser->get_trimmed_text('b', 'a'); + $tag = $parser->get_tag('b'); + my $text = $parser->get_trimmed_text('/a'); - my($rating, $val) = $text =~ m!(\d+\.?\d+)\/.*?\((\d+\,?\d+)\s.*?\)!; + my($rating, $val) = $text =~ m!(\d+\.?\d+)\/.*?\((\d+\,?\d+)\s.*?!; $val =~ s/\,// if $val; $self->{_rating} = [$rating, $val];
Fixed -- Best Regards, Michael Stepanov, Senior Software Developer