2017 © Pedro Peláez
 

api tomatoes

Rotten Tomatoes API wrapper for Laravel 5

image

joearcher/tomatoes

Rotten Tomatoes API wrapper for Laravel 5

  • Sunday, March 1, 2015
  • by joe_archer
  • Repository
  • 2 Watchers
  • 3 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Tomatoes

Simple Rotten Tomatoes API wrapper for Laravel 5, (*1)

Setup

Require this package in composer.json and run composer update, (*2)

"joearcher/tomatoes": "dev-master"

After updating add the ServiceProvider the the providers array in app/config/app.php, (*3)

'Joearcher\Tomatoes\TomatoesServiceProvider',

And then you can add the facade to the Facades array, (*4)

'Tomatoes' =>   'Joearcher\Tomatoes\Facades\Tomatoes',

Publish the config, (*5)

artisan vendor:publish

This creates a tomatoes.php file in app/config, (*6)

Add your api key to tomatoes.php, (*7)

'apikey' => '<Your API key here>'

Usage

Available endpoints:, (*8)

  • Search - api.rottentomatoes.com/api/public/v1.0/movies.json
  • Movie info - api.rottentomatoes.com/api/public/v1.0/movies/[movie_id].json
  • Movie cast - api.rottentomatoes.com/api/public/v1.0/movies/[movie_id]/cast.json
  • Movie reviews - api.rottentomatoes.com/api/public/v1.0/movies/[movie_id]/reviews.json
  • Similar movies - api.rottentomatoes.com/api/public/v1.0/movies/[movie_id]/similar.json

All requests return an array()., (*9)

Search queries can be returned as pages of results, pagination can be performed with the 2nd and 3rd parameters, though they are optional., (*10)

Performing a basic search:, (*11)

Tomatoes::search("Terminator");

Will return all results for the given search term., (*12)

To search for the term "war" limiting to 10 results per page and viewing page 2 of the results:, (*13)

Tomatoes::search("war",10,2);

Results are ordered by most recent release date first, this is set by the API and cannot be changed., (*14)

Movie info

Further information on a specific movie by it's ID:, (*15)

Tomatoes::movie(771245718);

Will return the detailed information for 'Django Unchained', (*16)

Other info

The remaining endpoints take the same format:, (*17)

Tomatoes::cast(771245718);

Tomatoes::reviews(771245718);

Tomatoes::similar(771245718);

Thanks

Made possible by the awesome Guzzle Http client, (*18)

The Versions

01/03 2015

dev-master

9999999-dev

Rotten Tomatoes API wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Joe Archer

api wrapper rotten tomatoes movie search

01/03 2015

0.1

0.1.0.0

Rotten Tomatoes API wrapper for Laravel 5

  Sources   Download

MIT

The Requires

 

by Joe Archer