adrenth / tvrage
API Client for tvrage.com
Installs: 85
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/adrenth/tvrage
Requires
- php: >=5.5
- doctrine/cache: ^1.4
- guzzlehttp/guzzle: ^6.0
- symfony/serializer: ^2.7
Requires (Dev)
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2020-05-23 14:42:18 UTC
README
This is an API client for the tvrage.com website. It's using the XML feeds that are publicly available. For more info visit http://services.tvrage.com/info.php?page=main.
Installation
Install this package using Composer:
composer require adrenth/tvrage
Caching
Since the tvrage.com XML feeds are usually very slow I advise you to use caching. This package requires a Doctrine Cache instance.
To disable caching just provide a VoidCache or ArrayCache instance.
For more information about Doctrine Cache visit https://github.com/doctrine/cache
Usage
<?php
require '../vendor/autoload.php';
$cache = new \Doctrine\Common\Cache\FilesystemCache('path/to/temp');
$client = new Adrenth\Tvrage\Client($cache);
// Search TV-serie Top Gear
$response = $client->search('top gear'); // ShowsResponse
// Perform a full search on Ray Donovan
$response = $client->fullSearch('ray donovan'); // ShowsResponse
// Get (full) show info by passing the tvrageid (Buffy the Vampire Slayer)
$response = $client->showInfo(2930); // ShowResponse
$response = $client->fullShowInfo(2930); // ShowResponse
// Get Episode list of Buffy the Vampire Slayer
$response = $client->episodeList(2930); // SeasonsResponse
// Get Episode infor of Buffy the Vampire Slayer (season 2, episode 4)
$response = $client->episodeInfo(2930, 2, 4); // EpisodeResponse
SeasonsResponse; contains 0 or moreSeasoninstances (episodeList)EpisodeResponse; contains 0 or 1Episodeinstance (episodeInfo)ShowResponse; contains 0 or 1Showinstance (showInfo)ShowsResponse; contains 0 or moreShowinstances (search, fullSearch)
Contributing
Please contribute to make this package even better.