PHP TVDB
What is it?
PHPTVDB is a PHP library for accessing TV show information such as episodes, actors, showtimes and descriptions. It does this by querying TheTVDB.com.
How do I use it?
- Download it
- Unzip it
- Put it somewhere you'll remember
- Obtain an API key here: thetvdb.com (registration required, sorry! I don't control the database.)
- Add your API key to TVDB.php on line 15
- Include the file 'TVDB.php'
- Start using it like this:
<?php
include('/path/to/tvdb/TVDB.php');
//Returns array of TV_Show objects matching
//'Battlestar Galactica'
$tvShows = TV_Shows::search("Battlestar Galactica");
$tvShow = $tvShows[0];
//'Battlestar Galactica (2003)'
echo $tvShow->seriesName;
//array('Edward James Olmos', 'Grace Park')
print_r($tvShow->actors);
//Fetch a specific episode. getEpisode($season, $episode)
$tvEpisode = $tvShow->getEpisode(2, 11);
//'Resurrection Ship (1)'
echo $tvEpisode->name;
//'The Battlestars Galactica and...'
echo $tvEpisode->overview;
?>
Requirements:
- PHP 5 (tested with PHP 5.2.5)
Want to Contribute?
Visit the Google Code page where you can checkout the source and submit patches.
Notes:
Found a bug? Please file an issue on Google Code if you find a bug. I'll put up some sort of public bug tracking system soon.
Please contribute back to TheTVDB.com. You can do this by adding more show information or donating money.
