承接 sparks-coding/movie-information 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sparks-coding/movie-information

Composer 安装命令:

composer require sparks-coding/movie-information

包简介

Wrapper for the OMDb API

README 文档

README

A Simple PHP Wrapper for the OMDb API (https://www.omdbapi.com/)

Usage

// Include the Class
require 'MovieInformation.php';

// Namespace
use SparksCoding\MovieInformation\MovieInformation;

// Get move by title
$movie = new MovieInformation('The Matrix', array('plot'=>'full', 'tomatoes'=>'true'));

echo $movie->title;      // The Matrix
echo $movie->year;       // 1999
echo $movie->rated;      // R
echo $movie->released;   // 31 Mar 1999
echo $movie->runtime;    // 136 min
echo $movie->genre;      // Action, Sci-Fi
echo $movie->director;   // Andy Wachowski, Lana Wachowski
echo $movie->actors;     // Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving
echo $movie->plot;       // A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.
echo $movie->language;   // English
echo $movie->country;    // USA, Australia
echo $movie->awards;     // Won 4 Oscars. Another 34 wins & 39 nominations.
echo $movie->poster;     // http://ia.media-imdb.com/images/M/MV5BMTkxNDYxOTA4M15BMl5BanBnXkFtZTgwNTk0NzQxMTE@._V1_SX300.jpg
echo $movie->metascore;  // 73
echo $movie->imdbRating; // 8.7
echo $movie->imdbVotes;  // 1023621
echo $movie->imdbID;     // tt0133093

// Additional Information Returned when 'tomatoes' is set to true

echo $movie->tomatoMeter;        // RT Meter
echo $movie->tomatoImage;        // RT Image
echo $movie->tomatoRating;       // RT Rating
echo $movie->tomatoReviews;      // Number of RT Reviews
echo $movie->tomatoFresh;        // Number of RT Fresh Reviews
echo $movie->tomatoRotten;       // Number of RT Rotten Reviews
echo $movie->tomatoConsensus;    // RT Consensus
echo $movie->tomatoUserMeter;    // RT User Meter
echo $movie->tomatoUserRating;   // RT User Rating
echo $movie->tomatoUserReviews;  // Number of RT User Reviews
echo $movie->dvd;                // DVD Release Date
echo $movie->boxOffice;          // Box Office
echo $movie->production;         // Production Company
echo $movie->website;            // Movie Website

// Get movie by IMDB ID
$movie = new MovieInformation('tt0133093');

echo $movie->title; // The Matrix

Options

Option Values Default Description
plot short, full short Return short or full movie plot
tomatoes true, false false Return additional information from Rotten Tomatoes

Methods

get($key, $asArray)

Get the value of specified key. Optionally return the value as an array.

// As String
$actors = $movie->get('actors'); 

echo $actors // Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving

// As Array
$actors = $movie->get('actors', true);

print_r($actors); // Array ( [0] => Keanu Reeves [1] => Laurence Fishburne [2] => Carrie-Anne Moss [3] => Hugo Weaving ) 

getMultiple(array('title', 'year'))

Get multiple values returned in an array.

$multiple = $movie->getMultiple(array('title', 'year', 'genre', 'dvd'));

print_r($multiple);

// Array
// (
//     [title] => The Matrix
//     [year] => 1999
//     [genre] => Action, Sci-Fi
//     [dvd] => 21 Sep 1999
// )

getAll($asJson)

Get all the movie's information as an array or JSON.

$all = $movie->getAll();

print_r($all);

// Array
// (
//     [title] => The Matrix
//     [year] => 1999
//     [rated] => R
//     [released] => 31 Mar 1999
//     [runtime] => 136 min
//     [genre] => Action, Sci-Fi
//     [director] => Andy Wachowski, Lana Wachowski
//     [writer] => Andy Wachowski, Lana Wachowski
//     [actors] => Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving
//     [plot] => A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.
//     [language] => English
//     [country] => USA, Australia
//     [awards] => Won 4 Oscars. Another 34 wins & 40 nominations.
//     [poster] => http://ia.media-imdb.com/images/M/MV5BMTkxNDYxOTA4M15BMl5BanBnXkFtZTgwNTk0NzQxMTE@._V1_SX300.jpg
//     [metascore] => 73
//     [imdbRating] => 8.7
//     [imdbVotes] => 1,037,112
//     [imdbID] => tt0133093
//     [type] => movie
//     [tomatoMeter] => 87
//     [tomatoImage] => certified
//     [tomatoRating] => 7.6
//     [tomatoReviews] => 139
//     [tomatoFresh] => 121
//     [tomatoRotten] => 18
//     [tomatoConsensus] => Thanks to the Wachowskis' imaginative vision, The Matrix is a smartly crafted combination of spectacular action and groundbreaking special effects.
//     [tomatoUserMeter] => 85
//     [tomatoUserRating] => 3.6
//     [tomatoUserReviews] => 33317892
//     [dvd] => 21 Sep 1999
//     [boxOffice] => N/A
//     [production] => Warner Bros. Pictures
//     [website] => http://www.whatisthematrix.com
//     [response] => True
// )

// As JSON
$json = $movie->getAll(true);

echo $json;

// {"title":"The Matrix","year":"1999","rated":"R","released":"31 Mar 1999","runtime":"136 min","genre":"Action, Sci-Fi","director":"Andy Wachowski, Lana Wachowski","writer":"Andy Wachowski, Lana Wachowski","actors":"Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving","plot":"A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.","language":"English","country":"USA, Australia","awards":"Won 4 Oscars. Another 34 wins & 40 nominations.","poster":"http:\/\/ia.media-imdb.com\/images\/M\/MV5BMTkxNDYxOTA4M15BMl5BanBnXkFtZTgwNTk0NzQxMTE@._V1_SX300.jpg","metascore":"73","imdbRating":"8.7","imdbVotes":"1,037,112","imdbID":"tt0133093","type":"movie","tomatoMeter":"87","tomatoImage":"certified","tomatoRating":"7.6","tomatoReviews":"139","tomatoFresh":"121","tomatoRotten":"18","tomatoConsensus":"Thanks to the Wachowskis' imaginative vision, The Matrix is a smartly crafted combination of spectacular action and groundbreaking special effects.","tomatoUserMeter":"85","tomatoUserRating":"3.6","tomatoUserReviews":"33317892","dvd":"21 Sep 1999","boxOffice":"N\/A","production":"Warner Bros. Pictures","website":"http:\/\/www.whatisthematrix.com","response":"True"}

To Do

This is a work in progress. More robust options are on the way.

sparks-coding/movie-information 适用场景与选型建议

sparks-coding/movie-information 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 59 次下载、GitHub Stars 达 7, 最近一次更新时间为 2015 年 05 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「movies」 「movie」 「imdb.com」 「omdbapi.com」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 sparks-coding/movie-information 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 sparks-coding/movie-information 我们能提供哪些服务?
定制开发 / 二次开发

基于 sparks-coding/movie-information 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 59
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPLv3
  • 更新时间: 2015-05-26