Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

robotomize/rotten-tomatoes-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RottenTomatoesAPI

Rotten tomatoes API PHP wrapper

Install

git clone https://github.com/robotomize/RottenTomatoesAPI.git

RottenAPI methods instructions

  • Search movies
  • Upcoming movies
  • Opening movies
  • In Theater movies
  • Movie info

Usage

Search

<?php
$tt = new RottenApi(['apiKey' => '', 'raw' => false]);
print $tt->search('Iron Man', '1');
// return array of objects

Get upcoming movies

<?php

$t2 = new RottenApi(['apiKey' => 'your api key', 'raw' => false]);
print_r($tt->getUpcomingMovies());

In theater movies

<?php
$t3 = new RottenApi();
print_r($t3->getInTheatreMovies());

Opening movies

<?php
$t3 = new RottenApi();
print_r($t3->getOpeningMovies());

Info about movie by id

<?php

$t3 = new RottenApi();
print_r($t3->getMovieInfo((int)$id));

Parameters

  • Use raw flag to get the results in the original format.
  • You can put the key in the / data / credentials for easy debugging or to pass it in the parameters.
<?php
 $t2 = new RottenApi(['apiKey' => 'your api key', 'raw' => true]);
 $t2->getOpeningMovies();
 // return JSON

 $t2 = new RottenApi(['apiKey' => 'your api key', 'raw' => false]);
 $t2->getOpeningMovies();
 // return array of RottenMovieContainer objects
 ?>

Factory

<?php
print_r(RottenFactory::makeRotten()->getInTheatreMovies());
print_r(RottenFactory::makeRotten(['raw' => true])->getInTheatreMovies());
print RottenFactory::makeRotten()->getMovieInfo(771416235)[0]->getTitle();
print RottenFactory::makeRotten()->getMovieInfo(771416235)[0]->getSynopsis();
 ?>

About

Rotten tomatoes API PHP wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages