示例#1
0
 public function testSearching()
 {
     $shows = TV_Shows::search("Battlestar Galactica");
     $this->assertTrue(count($shows) >= 1);
 }
示例#2
0
function show_info($title)
{
    //Remove soft hyphens
    $title = str_replace("­", "", $title);
    $episode_data = guess_match($title, true);
    if ($episode_data === false) {
        $isShow = false;
        $name = $title;
        $data = '';
    } else {
        if (preg_match('/\\d+x\\d+/', $episode_data['episode'])) {
            $epiInfo = 1;
        } else {
            $epiInfo = 0;
        }
        $isShow = $episode_data['episode'] == 'noShow' ? false : true;
        $name = $episode_data['key'];
        $data = $episode_data['data'];
    }
    $episode_num = $episode_data['episode'];
    $shows = TV_Shows::search($name);
    if (count($shows) == 1) {
        episode_info($shows[0], $episode_num, $isShow, $epiInfo);
    } else {
        if (count($shows) > 1) {
            episode_info($shows[0], $episode_num, $isShow, $epiInfo);
        } else {
            episode_info($shows[0], $episode_num, 0, 0);
        }
    }
}
示例#3
0
文件: fetch.php 项目: aamkTV/webhooks
 * function for this) that can be accessed by this script.
 * 
 * Uses the useful TVDB library by Ryan Doherty
 *
 * @author Jason Botello <*****@*****.**>
 **/
// include the TheTVDB API files
require 'TVDB.php';
// remember to update this file with your TVDB API key
$txt_file = file_get_contents('containingfile.txt');
// set raw video output file from media server
$rows = explode('*', $txt_file);
$showName = $rows[0];
$fileName = $rows[1];
$playlistPosition = $rows[2];
$shows = TV_Shows::search($showName);
$show = $shows[0];
$finalShowName = $show->seriesName;
// process IMDB link
if ($show->imdbId) {
    $imdb_link = "&raquo; <a href='http://imdb.com/title/{$show->imdbId}' style='font-weight: bold;color: #ffa531;text-decoration: underline;font-size: 10px;' target='_blank'>IMDB</a>";
} else {
    $imdb_link = null;
}
// process TVDB link
if ($show->id) {
    $tvdbshow_link1 = "<a href='http://thetvdb.com/?tab=series&id={$show->id}' style='font-weight: bold;color: #ff7800;text-shadow: 1px 1px 0px #000000;' target='_blank'>";
    $tvdbshow_link2 = "</a>";
} else {
    $tvdbshow_link1 = null;
    $tvdbshow_link2 = null;