fabianbeiner/php-imdb-grabber
Composer 安装命令:
composer require fabianbeiner/php-imdb-grabber
包简介
This PHP library enables you to scrape data from IMDB.com.
README 文档
README
This PHP library enables you to scrape data from IMDB.com.
This script is a proof of concept. It’s working, but you shouldn’t use it. IMDb doesn’t allow this method of data fetching. I do not use or promote this script. You’re responsible for using it.
The technique used is called “web scraping.” Which means, if IMDb changes any of their HTML, the script is going to fail. I won’t update this on a regular basis, so don’t count on it to be working all the time.
License
Example Usage
<?php include_once 'imdb.class.php'; $IMDB = new IMDB('Movie Title or IMDB URL'); if ($IMDB->isReady) { print_r($IMDB->getAll()); } else { echo 'Movie not found. 😞'; }
Available Methods
Get all available data
getAll()
Also Known As
getAka()
All local names
getAkas()
Aspect Ratio
getAspectRatio()
Awards
getAwards()
Budget
getBudget()
Cast
getCast($iLimit = 0, $bMore = true) - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed
Cast Images
getCastImages($iLimit = 0, $bMore = true, $sSize = 'small', $bDownload = false) - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, $sSize defines the size of the cast image "small, mid and big", $bDownload if the cast image should be downloaded or not
Cast (with links)
getCastAsUrl($iLimit = 0, $bMore = true, $sTarget = '') - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, $sTarget defines a target
Cast and Character
getCastAndCharacter($iLimit = 0, $bMore = true) - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed
Cast and Character (with links)
getCastAndCharacterAsUrl($iLimit = 0, $bMore = true, $sTarget = '') - $iLimit defines the maximum amount of people returned, $bMore if "…" should be added to the string if needed, $sTarget defines a target
Certification
getCertification()
Color
getColor()
Company
getCompany()
Company (with links)
getCompanyAsUrl($sTarget = '') - $sTarget defines a target
Country
getCountry()
Country (with links)
getCountryAsUrl($sTarget = '') - $sTarget defines a target
Creator
getCreator()
Creator (with links)
getCreatorAsUrl($sTarget = '') - $sTarget defines a target
Description
getDescription()
Director
getDirector()
Director (with links)
getDirectorAsUrl($sTarget = '') - $sTarget defines a target
Distributor
getDistributor($iLimit = 0, $bMore = true) - $iLimit defines the maximum amount of distributors returned, $bMore if "…" should be added to the string if needed
Distributor (with links)
getDistributorAsUrl($sTarget = '') - $sTarget defines a target
Episode
getEpisodeTitle() - returns the episode title of the tv show
Genre
getGenre()
Genre (with links)
getGenreAsUrl($sTarget = '') - $sTarget defines a target
Gross
getGross() to get cumulative worldwide gross
Language
getLanguage()
Language (with links)
getLanguageAsUrl($sTarget = '') - $sTarget defines a target
Location
getLocation()
Location (with links)
getLocationAsUrl($sTarget = '') - $sTarget defines a target
MPAA
getMpaa()
Metacritics
getMetaCritics() - returns all critic reviews
Metascore
getMetaScore() - returns the average score and number of votes based on metacritic.
Music Composer
getMusic()
Music Composer (with links)
getMusicAsUrl($sTarget = '') - $sTarget defines a target
Plot
getPlot($iLimit = 0) - $iLimit defines the maximum characters returned
Plot Keywords
getPlotKeywords()
Poster
getPoster($sSize = 'small', $bDownload = true) - $sSize defines small or big poster size, $bDownload if the poster should be downloaded or not
Rating
getRating()
Release Date
getReleaseDate()
Release Dates
getReleaseDates() returning all release dates for each country
Runtime
getRuntime()
Seasons
getSeasons()
Seasons (with links)
getSeasonsAsUrl($sTarget = '') - $sTarget defines a target
Sound Mix
getSoundMix()
Tagline
getTagline()
Title
getTitle($bForceLocal = false) - $bForceLocal tries to return the original name of the movie
Trailer
getTrailerAsUrl($bEmbed = false) - $bEmbed defines if you want to link to player directly or not.
TVInfo
getTVInfo() - returns an array of all season/episodes of a tv show (includes plot/rating/votes/airdate).
Type
getType() - returns the type of the title (movie, tv episode, tv series)
Url
getUrl()
User Review
getUserReview()
Votes
getVotes()
Writer
getWriter()
Writer (with links)
getWriterAsUrl($sTarget = '') - $sTarget defines a target
Year
getYear()
Bugs?
If you run into any malfunctions, feel free to submit an issue. Make sure to enable debugging: const IMDB_DEBUG = true; in imdb.class.php.
fabianbeiner/php-imdb-grabber 适用场景与选型建议
fabianbeiner/php-imdb-grabber 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.75k 次下载、GitHub Stars 达 276, 最近一次更新时间为 2014 年 12 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「client」 「imdb」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fabianbeiner/php-imdb-grabber 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fabianbeiner/php-imdb-grabber 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fabianbeiner/php-imdb-grabber 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
IMDB API that can fetch film data and search results
A PSR-7 compatible library for making CRUD API endpoints
Mock PSR-18 HTTP client
Asynchronous MQTT client built on React
An example project using a multi layer feed forward neural network for text sentiment classification trained with 25,000 movie reviews from IMDB.
Client for Google Directions API to add interpolated points to a route consisting of given coordinates.
统计信息
- 总下载量: 4.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 279
- 点击次数: 17
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-09