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.
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
AUTHOR
Christopher Key <cjk32@cam.ac.uk>
COPYRIGHT AND LICENCE
Copyright (C) 2010 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.