lsv/tvmazeapi

PHP Wrapper for TV Maze API

1.0.6 2017-01-13 09:46 UTC

This package is auto-updated.

Last update: 2024-10-27 22:25:29 UTC


README

Build Status codecov SensioLabsInsight StyleCI

PHP wrapper for tvmaze.com API

Install

composer require lsv/tvmazeapi

or add it to your composer.json file

"require": {
    "lsv/tvmazeapi": "^1.0"
}

Usage

use Lsv\TvmazeApi\Api\Show;

// Search for a show
$results = Show::getInstance()->search($query);
// $results = Lsv\TvmazeApi\Response\ShowResponse[]

// Search for a single show
$result = Show::getInstance()->singleSearch($query, true, true);
// $result = Lsv\TvmazeApi\Response\ShowResponse
// first true = Embed episodes
// second true = Embed next episode

// Find by tvmaze ID
$result = Show::getInstance()->findById($id, true, true);
// $result = Lsv\TvmazeApi\Response\ShowResponse
// first true = Embed episodes
// second true = Embed next episode

// Find by another sites ID
// Following methods can be used: lookupFromTvrage, lookupFromThetvdb or lookupFromImdb
$result = Show::getInstance()->lookupFromImdb($id);
// $result = Lsv\TvmazeApi\Response\ShowResponse
// first true = Embed episodes
// second true = Embed next episode

What and what not

License

The MIT License (MIT)

Copyright (c) 2016 Martin Aarhof martin.aarhof@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.