dawson/tvdb
Composer 安装命令:
composer require dawson/tvdb
包简介
A package for searching the TVDB database with Laravel.
README 文档
README
A dedicated Laravel package for the TVDB API. The documentation for this package isn't 100% at the moment as I'm still developing as I go along. So expect the documentation to improve shortly.
Installation
To install, use the following to pull the package in via Composer.
composer require dawson/tvdb
Now register the Service provider in config/app.php
'providers' => [ ... Dawson\TVDB\TVDBServiceProvider::class, ],
And also add the alias to the same file.
'aliases' => [ ... 'TVDB' => Dawson\TVDB\TVDBFacade::class, ],
Configuration
You now need to publish the tvdb.php config.
php artisan vendor:publish --provider="Dawson\TVDB\TVDBServiceProvider"
Now add the following environment variables to your .env file. You can obtain your user key and api key from your account on TVDB
TVDB_USERNAME=
TVDB_USERKEY=
TVDB_APIKEY=
Searching
To search for TV Series, do the following:
Here's an example:
$results = TVDB::search('Walking Dead'); return $results;
Where $results is a JSON response from the TVDB API. Here's an example response.
{
"data": [
{
"aliases": [],
"banner": "graphical/153021-g44.jpg",
"firstAired": "2010-10-31",
"id": 153021,
"network": "AMC",
"overview": "The world we knew is gone. An epidemic of apocalyptic proportions has swept the globe causing the dead to rise and feed on the living. In a matter of months society has crumbled. In a world ruled by the dead, we are forced to finally start living. Based on a comic book series of the same name by Robert Kirkman, this AMC project focuses on the world after a zombie apocalypse. The series follows a police officer, Rick Grimes, who wakes up from a coma to find the world ravaged with zombies. Looking for his family, he and a group of survivors attempt to battle against the zombies in order to stay alive.\r\n",
"seriesName": "The Walking Dead",
"status": "Continuing"
},
{
"aliases": [],
"banner": "graphical/290853-g5.jpg",
"firstAired": "2015-08-23",
"id": 290853,
"network": "AMC",
"overview": "A horrifying zombiocalypse spin-off series from The Walking Dead, set in the same universe but starting at a far earlier time in Los Angeles. The show follows normal people learning to deal with the rapidly growing collapse of civilization, at the very beginning of a zombie outbreak.\r\n\r\nIn Los Angeles, a city where people come to escape, shield secrets, and bury their pasts, we follow this mysterious outbreak as it threatens to disrupt what little stability high school guidance counselor Madison Clark and English teacher Travis Manawa have managed to assemble. \r\n\r\nThe pressure of blending two families while dealing with resentful, escapist, and strung out children takes a back seat when society begins to break down. A forced evolution, and survival of the fittest takes hold, as our dysfunctional family finds they must either reinvent themselves or embrace their darker histories.",
"seriesName": "Fear the Walking Dead",
"status": "Continuing"
}
]
}
Series
Using a series ID, you can also perform a lookup to fetch further information on a series.
$theWalkingDead = TVDB::series('153021')->get();
The get() method will also return JSON. Here's an example response.
{
"data": {
"added": "2010-03-30 01:30:16",
"addedBy": 76261,
"airsDayOfWeek": "Sunday",
"airsTime": "9:00 PM",
"aliases": [],
"banner": "graphical/153021-g44.jpg",
"firstAired": "2010-10-31",
"genre": [
"Action",
"Drama",
"Horror",
"Suspense"
],
"id": 153021,
"imdbId": "tt1520211",
"lastUpdated": 1474059455,
"network": "AMC",
"networkId": "",
"overview": "The world we knew is gone. An epidemic of apocalyptic proportions has swept the globe causing the dead to rise and feed on the living. In a matter of months society has crumbled. In a world ruled by the dead, we are forced to finally start living. Based on a comic book series of the same name by Robert Kirkman, this AMC project focuses on the world after a zombie apocalypse. The series follows a police officer, Rick Grimes, who wakes up from a coma to find the world ravaged with zombies. Looking for his family, he and a group of survivors attempt to battle against the zombies in order to stay alive.\r\n",
"rating": "TV-MA",
"runtime": "50",
"seriesId": "78582",
"seriesName": "The Walking Dead",
"siteRating": 9,
"siteRatingCount": 1354,
"status": "Continuing",
"zap2itId": "EP01324002"
}
}
Actors
You also have the ability to fetch actors from a series too.
$actors = TVDB::series('153021')->actors();
Episodes
You can fetch a full list of episodes too.
$episodes = TVDB::series('153021')->episodes();
Questions
Should you have any questions, please feel free to submit an issue.
dawson/tvdb 适用场景与选型建议
dawson/tvdb 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 159 次下载、GitHub Stars 达 10, 最近一次更新时间为 2016 年 09 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 dawson/tvdb 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dawson/tvdb 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 159
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-18