Maria Celina Baratang > WWW-TMDB-API0.04 > WWW::TMDB::API

Download:
WWW-TMDB-API0.04.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 0.04   Source  

NAME ^

WWW::TMDB::API - TMDb API (http://api.themoviedb.org) client

VERSION ^

Version 0.04

SYNOPSIS ^

        use WWW::TMDB::API;

        # The constructor has 2 parameters - the api_key and the optional LWP::UserAgent object, ua.
        my $tmdb_client = WWW::TMDB::API->new( 'api_key' => 'your tmdb api key' );

        #  Retrieve information about the person with ID == 287
        $tmdb_client->person->info( ID => 287 );

        # Searches the themoviedb.org database for an actor, actress or production member with name 'Brad+Pitt'
        $tmdb_client->person->search( query => 'Brad+Pitt' );

        # Searches the themoviedb.org database for an actor, actress or production member with name 'Brad'
        $tmdb_client->person->search( query => 'Brad' );

        #  Determines the last movie created in the themoviedb.org database.
        $tmdb_client->movie->latest();

DESCRIPTION ^

This module implements version 3 of the TMDb API. See http://help.themoviedb.org/kb/api/about-3 for the documentation. The module uses the same parameter names used by the API. The method names have been slightly changed. Here's the mapping of the method names used by this this module and the corresponding method names in the TMDb API:

                                      TMDB API                           WWW::TMDB::API
                                      ----------------------             -------------------
    Search Movies                     search/movie                       movie->search() 
    Search People                     search/person                      person->search()
    Movie Info                        movie/[TMDb ID]                    movie->info()
    Movie Alternative Titles          movie/[TMDb ID]/alternative_titles movie->alternative_titles()
    Movie Casts                       movie/[TMDb ID]/casts              movie->casts()
    Movie Images                      movie/[TMDb ID]/images             movie->images()
    Movie Keywords                    movie/[TMDb ID]/keywords           movie->keywords()
    Movie Release Info                movie/[TMDb ID]/releases           movie->releases()
    Movie Trailers                    movie/[TMDb ID]/trailers           movie->trailers()
    Movie Translations                movie/[TMDb ID]/translations       movie->translations()
    Person Info                       person/[TMDb ID]/info              person->info()
    Person Credits                    person/[TMDb ID]/credits           person->credits()
    Person Images                     person/[TMDb ID]/images            person->images()
    Latest Movie                      latest/movie                       movie->latest()

The API requires an API key which can be generated from http://api.themoviedb.org. This module converts the API output to Perl data structure using the module JSON. This module does not support update the method, Movie Add Rating.

SUBROUTINES/METHODS ^

new( %params )

Returns a new instance of the WWW::TMDB::API class.

movie->search( %params )

Searches for movies.

person->search( %params )

Searches for actors, actresses, or production members.

        $result = $api->person->search( 'query' => 'Newman' );

movie->info( %params )

Retrieves basic information about a movie. Building image urls from the file_paths returned by this method is discussed in the document http://help.themoviedb.org/kb/api/configuration.

        $result = $api->movie->info( ID => 903 );

movie->alternative_titles( %params )

Retrieves a movie's alternative titles.

        $result = $api->movie->alternative_titles( ID => 903 );
        $result = $api->movie->alternative_titles( ID => 903, 'language' => 'fr' );

movie->casts( %params )

Retrieves a movie's cast information.

        $result = $api->movie->casts( ID => 903 );

movie->images( %params )

Retrieves all of the images for a particular movie. Building image urls from the file_paths returned by this method is discussed in the document: http://help.themoviedb.org/kb/api/configuration

        $result = $api->movie->images( ID => 903 );
        $result = $api->movie->images( ID => 903, 'language' => 'en' );

movie->keywords( %params )

Retrieves the keywords for a movie.

        $result = $api->movie->keywords( ID => 903 );

movie->releases( %params )

Retrieves release and certification data for a specific movie.

        $result = $api->movie->releases( ID => 903 );

movie->trailers( %params )

Retrieves the trailers for a movie.

        $result = $api->movie->trailers( ID => 903 );

movie->translations( %params )

Retrieves the list of translations for a movie.

        $result = $api->movie->translations( ID => 903 );

person->info( %params )

Retrieves basic information about a person. Building image urls from the file_paths returned by this method is discussed in the document: http://help.themoviedb.org/kb/api/configuration

         $result = $api->person->info( ID => 3636 );

person->credits( %params )

Retrieves the movies that have cast or crew credits for a person.

         $result = $api->person->credits( ID => 3636 );

person->images( %params )

Retrieves all the profile images of the person. Building image urls from the file_paths returned by this method is discussed in the document: http://help.themoviedb.org/kb/api/configuration]

         $result = $api->person->images( ID => 3636 );

movie->latest( )

Returns the newest movie created in the themoviedb.org database.

AUTHOR ^

Maria Celina Baratang, <maria at zambale.com>

BUGS ^

Please report any bugs or feature requests to bug-www-tmdb-api at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-TMDB-API. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc WWW::TMDB::API

You can also look for information at:

ACKNOWLEDGEMENTS ^

LICENSE AND COPYRIGHT ^

Copyright 2012 Maria Celina Baratang.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: