search((string) $argv[1], (string) $argv[2]); if (is_object($search) && $search->data->Response !== 'False') { dump($search->data->Search[0]->Title.PHP_EOL); } // Use the first show found (highest match) and get the requested season/episode from $argv if (is_object($search) && $search->data->Response !== 'False') { $search = $omdb->fetch('i', $search->data->Search[0]->imdbID); dump($search); } else { ColorCLI::error('Error retrieving OMDb API data.'); exit(); } } else { ColorCLI::error('Invalid arguments. This script requires a text string (show name), and a second argument, movie or series.'); exit(); }