Subject: | New feature for grabbing movie rating (not user rating) |
Hi, This is for IMDB::Movie-0.12
Have have added code in to grab the movie industry rating. This code could probably be modified as I hard coded the US rating (all I was interested in) but I didn't know the best way to pass what country to grab the rating for.
Here is the _rate routine... (do you prefer I attach patch files instead?)
sub _rate {
my $parser = shift;
my ( $tag, $tmp );
while ($tag = $parser->get_tag('a')) {
$tmp = $tag->[1]->{href};
if ( $tmp =~ /certificates=USA:(.*)\&\&/ ) {
return $1;
}
$tmp = undef;
}
return undef;
}
The line rate -> _rate($parser) also needs to be added into the $self hash under new.
---- Kirk