The Movie Database Support

Been a while since I made the first post to this conversation, so I felt an edit was needed. I'm happy to say as of today 25th March 1.0.0 has been released!

For those of you who come across here for the first time, what does it do? Well, it implements everything from TMDB, and contains loads of examples to start out from.

Please take a look at the project here https://github.com/wtfzdotnet/php-tmdb-api, and if you feel something is wrong or missing and no issues exist, please create an issue or solve it :-), I'm happy to take on some pull requests!

Thanks,

Michael Roterman

27 replies (on page 1 of 2)

Jump to last post

Next pageLast page

For anyone who wants to take a quick dive into it, I've already put the current state on Github ( develop branch ).

https://github.com/wtfzdotnet/php-tmdb-api

Do note this is far from finished!

Haven't been around for a while to update, have had a crazy workload lately, but managed to make some time this weekend to update and refactor a lot of the API. I would consider the API namespace to become stable in the next few days for retrieving RAW data, and I will be tagging this in github.

However, my main focus relies on the Model namespace, which should be as close as 1:1 to the whole TMDB API currently, and I will try my best to keep reflecting it. ( If the author might read this, is there any mailing list or place I should subscribe to to receive changes automatically? ).

This weekend I've introduced factories and repositories to the Movie section, where I am still experimenting around setlling for the right way to go. Provided I previously gave an example here's the current state ( Mind you this is a very simple and extensive example ):

require_once('../../../vendor/autoload.php');
require_once('../../../apikey.php');

$token  = new \Tmdb\ApiToken(TMDB_API_KEY);
$client = new \Tmdb\Client($token);

// This is optional, but if you want lots of data this is the way.
$append = new \Tmdb\Model\Movie\QueryParameter\AppendToResponse(array(
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::ALTERNATIVE_TITLES,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::CHANGES,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::CREDITS,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::IMAGES,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::KEYWORDS,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::LISTS,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::RELEASES,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::REVIEWS,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::SIMILAR_MOVIES,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::TRAILERS,
    \Tmdb\Model\Movie\QueryParameter\AppendToResponse::TRANSLATIONS,
));

$repository = new \Tmdb\Repository\MovieRepository($client);
$movie      = $repository->load(87421, array($append));

echo $movie->getTitle() . "\n";

echo "Alternative Titles\n";

foreach($movie->getAlternativeTitles() as $title) {
    printf(" - %s [%s]\n", $title->getTitle(), $title->getIso31661());
}

echo "Cast\n";

foreach($movie->getCredits()->getCast() as $person) {
    printf(" - %s as %s\n", $person->getName(), $person->getCharacter());
}

echo "Crew\n";

foreach($movie->getCredits()->getCrew() as $person) {
    printf(" - %s as %s\n", $person->getName(), $person->getJob());
}

echo "Images\n";

foreach($movie->getImages() as $image) {
    printf(" - %s\n", $image->getFilePath());
}

echo "Genres\n";

foreach($movie->getGenres() as $genre) {
    printf(" - %s\n", $genre->getName());
}

echo "Keywords\n";

foreach($movie->getKeywords() as $keyword) {
    printf(" - %s [%s]\n", $keyword->getName(), $keyword->getId());
}

echo "Releases\n";

foreach($movie->getReleases() as $release) {
    printf(" - %s on %s\n", $release->getIso31661(), $release->getReleaseDate());
}

echo "Translations\n";

foreach($movie->getTranslations() as $translation) {
    printf(" - %s\n", $translation->getName());
}

echo "Trailers\n";

foreach($movie->getTrailers() as $trailer) {
    printf(" - %s\n", $trailer->getUrl());
}

Currently this outputs:

Riddick
Alternative Titles
 - Riddick [US]
 - 星际传奇3 [CN]
 - The Chronicles of Riddick: Dead Man Stalking [US]
 - Riddick: Domptez les ténèbres [FR]
 - Riddick 3 [BR]
 - Riddick Ueberleben ist seine Rache [DE]
Cast
 - Vin Diesel as Riddick
 - Karl Urban as Lord Vaako
 - Katee Sackhoff as Dahl
 - Jordi Mollà as Santana
 - Bokeem Woodbine as Moss
 - Nolan Gerard Funk as Luna
 - Noah Danby as Nunez
 - Neil Napier as Rubio
 - Keri Hilson as 
 - Dave Bautista as Diaz
 - Matthew Nable as Boss Johns
Crew
 - David Twohy as Director
 - David Twohy as Writer
 - David Eggby as Cinematography
 - Scott Kroopf as Producer
 - Amy Halvorsen as Producer
 - Ted Field as Producer
 - Vin Diesel as Producer
Images
 - /7DlIoyQ3ecGMklVWyKsneZmVnsi.jpg
 - /o4L5wfptChTMOmaNDFRpTWAyrxF.jpg
 - /47aodUjJ35ybrwCd1AdbpHWxjoh.jpg
 - /AasqjiA81zQJlpHVP5K2TmQi3HO.jpg
 - /y2phgiP9OcPL86cgGczSPnung1a.jpg
 - /7EDc86sqEsJocUbJy4coF7MMjZQ.jpg
 - /6sHYGSPZb6d7Ex7WSgl528Hzaez.jpg
 - /v45JoTbH8NGcdce2Q9mus1fV8wD.jpg
 - /utERhydS3s0c7yxE2ZZGGccpTqX.jpg
 - /loRoAKEVmpqeVk4lpeEqHT0gSYD.jpg
 - /ohfpu2ErKqcfUvMAGRZhPG8bPfI.jpg
 - /15DG4xfGy34fznSbSpq9BA9D3Di.jpg
 - /hh5w3pKXR2hDJvi8fsQxJWJd8gX.jpg
 - /o0ZtQ7G2b3qVaqY0CKYRXBUulQd.jpg
 - /zF5UCwpRePO04Axl48UXt4LWlQP.jpg
 - /pBaKVXmCQQhZittkhTYQW9WYr2s.jpg
 - /vxK0U62pmt7keXKJlzPcocReteH.jpg
 - /mwuPRiZUvDl9tlOY2LsdjZbyzDX.jpg
 - /m24mV2MqwqxJibJ751VWa8tVmzK.jpg
 - /4Gd6ci5bUVZHxLzvnFfGOAtAeVg.jpg
 - /5J5JIAYpeqGrndWEvwYiTYwMKIz.jpg
 - /5mOrLnLC8K6xbIivAxr8Pi6YLUi.jpg
 - /kNyXor3SvOyHwBisgsLhYHi6t7K.jpg
 - /uAqbzU2JroOsKpSCi5Hke1cylmL.jpg
 - /A6p3gKuYZOelO9x9PI2k3wMs5hM.jpg
 - /hVaU9sxdzRWroXIX81jRAtGGz4T.jpg
Genres
 - Action
 - Science Fiction
 - Thriller
Keywords
 - planet [13194]
 - aliens [9951]
 - revenge [189830]
Releases
 - US on 2013-09-06
 - DE on 2013-09-19
 - BR on 2013-09-06
 - DK on 2013-09-05
 - AR on 2013-09-12
 - AU on 2013-09-12
 - RU on 2013-09-12
 - IT on 2013-10-17
 - BE on 2013-11-20
 - NL on 2013-09-05
 - AT on 2013-09-05
 - KZ on 2013-09-11
 - BG on 2013-09-06
 - GB on 2013-09-04
 - IE on 2013-09-04
 - FR on 2013-09-18
 - SK on 2013-09-05
 - ES on 2013-09-02
 - HK on 2013-09-05
 - HR on 2013-09-05
 - HU on 2013-09-05
 - ID on 2013-09-05
 - IL on 2013-09-05
 - KW on 2013-09-05
 - CA on 2013-09-06
 - EE on 2013-09-06
 - FI on 2013-09-06
 - IN on 2013-09-06
 - LT on 2013-09-06
 - NO on 2013-09-06
 - PL on 2013-09-06
 - TW on 2013-09-06
 - KH on 2013-09-12
 - SG on 2013-09-12
 - PK on 2013-09-13
 - PH on 2013-09-18
 - PT on 2013-09-19
 - IS on 2013-09-20
 - SE on 2013-09-20
 - TR on 2013-10-04
 - GR on 2013-10-17
 - PE on 2013-10-24
 - MX on 2013-10-25
 - CL on 2014-01-30
 - JP on 2014-03-08
Translations
 - English
 - Deutsch
 - Português
 - Nederlands
 - Italiano
 - Français
 - 中国
 - Pусский
 - Český
 - Magyar
 - Español
         - ภาษาไทย
 - български език
 - ελληνικά
 - Türkçe
 - Polski
 - svenska
 - Slovenščina
 - Dansk
 - suomi
Trailers
 - http://www.youtube.com/watch?v=zH3O-CeZckE
 - http://www.youtube.com/watch?v=F1Dm9zRogpE

Not everything is implemented yet and things are going to change, but feedback / contributions are more than welcome!

For time being I will just be implementing the simplest ways of searching / getting movies, in a later stadium I intend to provide a bunch of useful filters as soon as I get around to actually using the API myself.

The Api namespace should be ready for usage, the Model namespace will take a while longer, most of the Movie, Tv and People sections are "done" though for simple usage.

Awesome work wtfzdotnet.

As soon as you think it's "beta" ready, I'll add it to the list of libraries.

Thanks Travis! Have been delayed a bit but trying to catch up for a release this month. I've been exploring filtering options etc. and already have some implementations for collections.

Could you provide some small number of statistics if possible about the usage of ClientSessions ( the Account related options? ). It's been on the postpone list for now, but I'm curious to know how many people actually use this? I'd consider implementing the API side around this beta release if I have time for it. Altough I'd rather throw it out there as soon as most of it is done and stable, so people can start consuming it.

I'm not sure what kind of stats you're after but here's some loose info.

We average around 5,000 new sessions a month (that's all together, guest sessions and regular full sessions) across our API clients. This is an area that I've been really trying to get more usage. Ratings and guest sessions especially. It's really important to try and get those ratings for us.

If you have any other specific questions, let me know.

Thanks for the prompt response :-) seeing those statistics I guess I'll take a look integrating it on the Api namespace side before first beta, if easy I'll try to also cover it in the Model namespace at the same time however currently my priority lies in the rest of the API.

I'll do my best to get the full stack implemented as soon as I'm able to.

Some good news on the account function side, I seem to have found a contributor which will take on the task of integrating the account API. And possibly help out with other parts of this library :-), awaiting pull requests!

Been on a massive update to get everything unit tested, got to 22% now, and still have to work on some missing parts but I feel like I'm still on track now to reach the milestone in a month.

Seeing everything is unit tested from now on I've also connected travis-ci and scrutinizer to provide some insight on the current state:

https://travis-ci.org/wtfzdotnet/php-tmdb-api https://scrutinizer-ci.com/g/wtfzdotnet/php-tmdb-api/

The best place by the way to keep track of things is either starring/watching the github repository or (especially) keep your eye on scrutinizer https://scrutinizer-ci.com/g/wtfzdotnet/php-tmdb-api/ .

As soon as you see a master branch in the repository I also consider everything to be ready for it's first official version.

It has been a while since I've posted here, so just for a quick update for anyone following this topic:

Most of the API is considered alpha ready now, unfortunately the developer who would do the auth and account parts backed out of the project so I'm doing this on my own now. I've managed to implement the basics for RequestToken's and Sessions by now and a few Account methods in a local branch. As soon this is worked out and merged into develop and I'm happy with the rest of the state of the library I'll be tagging alpha.

The library has been updated to the latest change-sets in the API as far as I could keep up with ( If I missed anything please do create an issue on github! ).

I've also created a Symfony2 Bundle located here, https://github.com/wtfzdotnet/WtfzTmdbBundle , to make use of the library within Symfony2.

Thanks man! You're doing great! :-)

Hi Franscesco!

Thanks for that :-) I'm doing my best to make this beneficial for the whole community.

I'm wondering if you are currently making use of my implementation? And if so for what? I'm eager for some feedback from people :-) and curious where it is used.

API namespace now contains all account related methods, moving on to implementing this in the modeled namespace.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login