Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devvoh/tvmaze-api-client
TVmaze PHP API Client
https://github.com/devvoh/tvmaze-api-client
api-client php php56 php7 tvmaze tvmazeapi
Last synced: about 2 months ago
JSON representation
TVmaze PHP API Client
- Host: GitHub
- URL: https://github.com/devvoh/tvmaze-api-client
- Owner: devvoh
- License: mit
- Created: 2017-08-25T13:34:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-29T11:21:38.000Z (over 7 years ago)
- Last Synced: 2024-03-15T09:02:54.959Z (10 months ago)
- Topics: api-client, php, php56, php7, tvmaze, tvmazeapi
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tvmzaze-api-client
A very barebones API client, currently only intended to search for shows and get their information, including episodes. No crew list, etc. at this point.Here's the example script:
```php
$client = new TVmazeApi\Client();
$shows = $client->searchShow("firefl");// Loop through the shows and show their id & name
foreach ($shows as $show) {
echo "#{$show->id}: {$show->name}\n";
}echo "\n";
// Get Firefly by id
$show = $client->fetchShowById(180);
echo "{$show->name} episodes:\n";
foreach ($client->fetchEpisodesByShowId($show->id) as $episode) {
echo "{$episode->getNiceShortTag()} - {$episode->name}\n";
}
```To get only the highest-scoring search result:
```php
$client = new TVmazeApi\Client();$show = $client->searchOneShow("firefl");
```To get an array of matching search results:
```php
$shows = $client->searchShow("firefl");
```To get a show by its ID:
```php
$show = $client->fetchShowById(180);
```To get a show's episodes by the show's ID:
```php
$show = $client->fetchShowById(180);
$episodes = $client->fetchEpisodesByShowId($show->id);
```