TomatoPower

TomatoPower is a wrapper for the Rotten Tomatoes API.

Installation

Add this line to your application's Gemfile:

gem 'tomato_power'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tomato_power

Usage

Create a TomatoPower::Client.

>> client = TomatoPower.new <your_rotten_tomatoes_api_key>

note: You can also set ENV["ROTTEN_TOMATOES_API_KEY"] and omit passing your API key to the client.

Examples

Check out the Wiki for more details.

Search for a movie by title or IMDB id.

>> movies = client.search_by_title("The Dark Knight")

>> movies = client.search_by_id("0468569")

Both searches would result in:

>> movies[0].title
=> "The Dark Knight"

Search for similar movies:

>> movies = client.search_by_title("The Dark Knight")
>> similar_movies = movies[0].similar
>> similar_movies[0].title 
=> "Batman Begins"

Get cast of a movie:

>> actors = movie.cast
>> actor = actors[0]
>> actor.name
=> "Christian Bale"
>> actor.characters
=> ["Batman/Bruce Wayne"]

Get posters of a movie:

>> posters = movie.posters.thumbnail
=> "http://content6.flixster.com/movie/11/16/51/11165160_mob.jpg"

Get reviews of a movie:

>> reviews = movie.reviews
>> reviews[0].freshness
=> "fresh"
>> reviews[0].quote
=> "Christopher Nolan is much, much smarter than your average filmmaker."

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request