The Movie Database

Warning: This post is for the ultra technogeek.  It is our (small) contribution back to the open source community, which has provided Treasure Coast Film with so much!

At Treasure Coast Film we figure its obvious that we love old movies!  When you look at the list of our old movies (by clicking here) you will see that its extremely obvious we love old movies!  We love them so much that we made a webpage for them and even make a Twitter Post for one each and every day!

But you want to know, how did we get all that useful information onto our website?  But since you ask, it was pretty easy!  All it requires is some knowledge of PHP.

Let us show you how you can do it on your website:

1) Visit www.themoviedb.org and request an API Key.  This will take a couple days as the site is comprised of volunteers.

2)  Download the Source code by visiting:  https://github.com/glamorous/TMDb-PHP-API

3)  Use the code in your page like this:

<?php
//change this to whatever movie you want to search for
$title = "It's a Wonderful Life"

include('TMDb.php');
$tmdb = new TMDb('API_KEY_AS_GIVEN_BY_TMDB');

$movies = $tmdb->searchMovie($title);
print_r($movies);

?>

or

<?php

//If you have already searched for the movies, and know their TMDB ID Number
$id = "1585";

include('TMDb.php');
$tmdb = new TMDb('API_KEY_AS_GIVEN_BY_TMDB');

$movies = $tmdb->getMovie($id]);
print_r($movies);

?>

That is it.  It is that easy!  If you will stay tuned we will post the sql schema we used to keep the movie info.

One thought on “The Movie Database

Comments are closed.