NAME
WebService::MoviePosterDB - OO Perl interface to the movie poster database MoviePosterDB.
SYNOPSIS
my
$ws
= WebService::MoviePosterDB->new(
api_key
=>
"key"
,
api_secret
=>
"secret"
,
cache
=> 1,
cache_exp
=>
"12h"
);
my
$movie
=
$ws
->search(
type
=>
"Movie"
,
imdbid
=>
"tt0114814"
,
width
=> 300);
$movie
->title(),
": \n\n"
;
$movie
->page(),
"\n\n"
;
foreach
( @{
$movie
->posters()} ) {
$_
->image_location(),
"\n"
;
}
DESCRIPTION
WebService::MusicBrainz is an object-oriented interface to MoviePosterDB. It can be used to retrieve artwork for IMDB titles.
METHODS
new(%opts)
Constructor.
%opts can contain:
- api_key, api_secret
-
A key and secret are required to use the 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".
- tconst
-
IMDB id for the title, e.g. tt0114814
- imdbid
-
Alias for tconst
- title
-
Name of the title
- width
-
Image width for returned artwork
NOTES
The version 1 API, previously used by default, stopped as of 2011-09-27, and credentials are required to access the version 2 API. It is possible to access the version 2 API using test credentials (key, secret = "demo"), and this will be done for legacy applications that try to use the version 1 API. However, this feature is only intended for test purposes: legacy applications should be adapted, and new applications should not use it.
AUTHOR
Christopher Key <cjk32@cam.ac.uk>
COPYRIGHT AND LICENCE
Copyright (C) 2010-2011 Christopher Key <cjk32@cam.ac.uk>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.