
IMDB::Film - OO Perl interface to the movies database IMDB.

IMDB::Film 0.01

use IMDB;
my $imdbObj = new IMDB::Film(crit => 227445);
or
my $imdbObj = new IMDB::Film(crit => 'Troy');
if($imdbObj->status) {
print "Title: ".$imdbObj->title()."\n";
print "Year: ".$imdbObj->year()."\n";
print "Plot Symmary: ".$imdbObj->plot()."\n";
} else {
print "Something wrong: ".$imdbObj->error;
}

IMDB::Film is an object-oriented interface to the IMDB. You can use that module to retrieve information about film: title, year, plot etc.
Object's constructor. You should pass as parameter movie title or IMDB code.
my $imdb = new IMDB::Film(crit => <some code>);
or
my $imdb = new IMDB::Film(crit => <some title>);
Also, you can specify following optional parameters:
- proxy - define proxy server name and port;
- debug - switch on debug mode (on by default);
- cache - cache or not of content retrieved pages.
Initialize object.
Implemets functionality to search film by name.
Retrieve film title from film page. If was got search page instead of film page this method calls method _search_film to get list matched films and continue to process first one:
my $title = $film->title();
Get film year:
my $year = $film->year();
Retrieve url of film cover:
my $cover = $film->cover();
Retrieve film directors list each element of which is hash reference - { id => <ID>, name => <Name> }:
my @directors = @{ $film->directors() };
Retrieve film writers list each element of which is hash reference - { id => <ID>, name => <Name> }:
my @writers = @{ $film->writers() };
Retrieve film genres list:
my @genres = @{ $film->genres() };
Retrieve film tagline:
my $tagline = $film->tagline();
Retrieve film plot summary:
my $plot = $film->plot();
In scalar context returns film user rating, in array context returns film rating and number of votes:
my $rating = $film->rating();
or
my($rating, $vnum) = $film->rating();
print "RATING: $rating ($vnum votes )";
Retrieve film cast list each element of which is hash reference - { id => <ID>, name => <Full Name>, role => <Role> }:
my @cast = @{ $film->cast() };
Retrieve film duration in minutes:
my $duration = $film->duration();
Retrieve film produced countries list:
my @countries = $film->country();
Retrieve film languages list:
my @languages = $film->language();
Return string which contains error messages separated by \n:
my $errors = $film->error();
Return a status of retrieving an information about movie from IMDB: 1 - successful, 0 - something wrong
my $film = new IMDB::Film(crit => 'Troy');
if($film->status) {
print $film->title;
} else {
warn "Something wrong: ".$film->error;
}
Retrieve film user summary:
my $descr = $film->summary();
Retrieve list of film certifications each element of which is hash reference - { country => certificate }:
my @cert = $film->certifications();
Return full movie plot.
Contains list all object's properties. See description of pragma fields.
Matches USA film certification notation and age.

Nothing

Please, send me any found bugs by email: misha@thunderworx.com.

HTML::TokeParser, IMDB::BaseClass, IMDB::Persons, IMDB::Movie

Michael Stepanov (stepanov.michael@gmail.com)

Copyright (c) 2004, Michael Stepanov. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.