The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WebService::MoviePosterDB - OO Perl interface to the movie poster database MoviePosterDB.

SYNOPSIS

use WebService::MoviePosterDB;

my $ws = WebService::MoviePosterDB->new(cache => 1, cache_exp => "12h");

my $movie = $ws->search(type => "Movie", imdbid => "tt0114814", width => 300);

print $movie->title(), ": \n\n";
print $movie->page(), "\n\n";

foreach ( @{$movie->posters()} ) {
    print $_->image_location(), "\n";
}

DESCRIPTION

WebService::MusicBrainz is an object-oriented interface to MoviePosterDB. It can be used to retrieve artwork for IMDB titles.

AUTHOR

Christopher Key (cjk32@cam.ac.uk)

COPYRIGHT

Copyright 2010, Christopher Key. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.

METHODS

new(%opts)

Constructor.

%opts can contain:

api_version - Which API to use.

    1 - http://api.movieposterdb.com/json.inc.php

    2 - http://api.movieposterdb.com/json

Defaults to 1, unless an api_key is supplied in which case, defaults to 2

api_key, api_secret

A key and secret are required if using the version 2 API. Contact movieposterdb.com for details.

cache

Whether to cache responses. Defaults to true

cache_root

The root dir for the cache. Defaults to tmpdir();

cache_exp

How long to cache responses for. Defaults to "1h"

search(type => "Movie", %args)

Accesses MoviePosterDB and returns a WebService::MoviePosterDB::Movie object.

%args can contain:

type

Controls the type of resource being requested. Currently only supports "Movie".

imdbid

IMDB id for the title, e.g. tt0114814

title

Name of the title

width

Image width for returned artwork