Use league/climate in ColorCLI class

This commit is contained in:
DariusIII
2018-10-19 11:30:36 +02:00
parent 78148e52f4
commit bafe7c6b93
66 changed files with 706 additions and 806 deletions
+6 -4
View File
@@ -15,17 +15,19 @@ if (! empty($argv[1]) && ! empty($argv[2]) && ($argv[2] !== 'series' || $argv[2]
// Search for a show
$search = $omdb->search((string) $argv[1], (string) $argv[2]);
if (is_object($search) && $search->data->Response !== 'False') {
print_r($search->data->Search[0]->Title.PHP_EOL);
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);
print_r($search);
dump($search);
} else {
exit(ColorCLI::error('Error retrieving OMDb API data.'));
ColorCLI::error('Error retrieving OMDb API data.');
exit();
}
} else {
exit(ColorCLI::error('Invalid arguments. This script requires a text string (show name), and a second argument, movie or series.'));
ColorCLI::error('Invalid arguments. This script requires a text string (show name), and a second argument, movie or series.');
exit();
}