mrcnpdlk/imdbphp
Composer 安装命令:
composer require mrcnpdlk/imdbphp
包简介
Library for retrieving film and tv information from IMDb
关键字:
README 文档
README
Fork from tboothman/imdbphp
- PHP 7 support
- PSR16 cache support
imdbphp
PHP library for retrieving film and TV information from IMDb. Retrieve most of the information you can see on IMDb including films, TV series, TV episodes, people. Search for titles on IMDb, including filtering by type (film, tv series, etc). Download film posters and actor images.
Quick Start
- Include imdbphp/imdbphp using composer, clone this repo or download the latest release zip.
- Find a film you want the metadata for e.g. Lost in translation http://www.imdb.com/title/tt0335266/
- If you're not using composer or an autoloader include
bootstrap.php. - Get some data
$title = new \Imdb\Title(335266); $rating = $title->rating(); $plotOutline = $title->plotoutline();
Installation
This library scrapes imdb.com so changes their site can cause parts of this library to fail. You will probably need to update a few times a year. Keep this in mind when choosing how to install/configure.
For notifications of new releases try Sibbell
Install the files:
- Composer (recommended). Include the imdbphp/imdbphp package.
- Git clone. Checkout the latest release tag.
Install/enable the curl PHP extension
Configuration
LogInterface Psr\Log\LoggerInterface
$oInstanceLogger = new \Monolog\Logger('IMDB'); $oInstanceLogger->pushHandler(new \Monolog\Handler\ErrorLogHandler( \Monolog\Handler\ErrorLogHandler::OPERATING_SYSTEM, \Psr\Log\LogLevel::DEBUG ) );
CacheInterface (PSR16) Psr\SimpleCache\CacheInterface
$oInstanceCacheRedis = new \phpFastCache\Helper\Psr16Adapter( 'redis', [ "host" => null, // default localhost "port" => null, // default 6379 'defaultTtl' => 3600 * 24, // 24h 'ignoreSymfonyNotice' => true, ]);
Dependency injection
$oImdb = new Imdb\TitleSearch(null,$oInstanceLogger,$oInstanceCacheRedis);
Searching for a film
// include "bootstrap.php"; // Load the class in if you're not using an autoloader $search = new \Imdb\TitleSearch(); // Optional $config parameter $results = $search->search('The Matrix', [\Imdb\TitleSearch::MOVIE]); // Optional second parameter restricts types returned // $results is an array of Title objects // The objects will have title, year and movietype available // immediately, but any other data will have to be fetched from IMDb foreach ($results as $result) { /* @var $result \Imdb\Title */ echo $result->title() . ' ( ' . $result->year() . ')'; }
Searching for a person
// include "bootstrap.php"; // Load the class in if you're not using an autoloader $search = new \Imdb\PersonSearch(); // Optional $config parameter $results = $search->search('Forest Whitaker'); // $results is an array of Person objects // The objects will have name available, everything else must be fetched from IMDb foreach ($results as $result) { /* @var $result \Imdb\Person */ echo $result->name(); }
mrcnpdlk/imdbphp 适用场景与选型建议
mrcnpdlk/imdbphp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 241 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 12 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「imdb」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mrcnpdlk/imdbphp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mrcnpdlk/imdbphp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mrcnpdlk/imdbphp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
IMDB API that can fetch film data and search results
An example project using a multi layer feed forward neural network for text sentiment classification trained with 25,000 movie reviews from IMDB.
xMDB parser
A Laravel 5 PHP library for retrieving film and TV information from IMDb
Crawl IMDb movie rating, content rating, release date, poster, presentation, director, actor, duration and other information
Import and use IMDB data in Laravel.
统计信息
- 总下载量: 241
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2017-12-09