Ruby client to interact with MovieQuotes API - Live app: https://movie-quotes-app.herokuapp.com - API Docs: https://juanroldan.com.ar/movie-quotes-api
Switch branches/tags
Nothing to show
Clone or download
juanroldan1989 README updated
Another developer added to Projects section
Latest commit 143a662 Oct 4, 2018

README.md

movie_quotes ruby logo

MovieQuotes

Gem Version Code Climate Build Status Coverage Status Downloads License

Ruby client for MovieQuotes API

Features

  • Fetch well known quotes from more than 500 movies.
  • Search through movie quotes by actors, characters, movies, genres, years and even pieces of quotes.
  • Intuitive API interface navigation.
  • URL generation process fully tested when applying filters for each request.
  • API integration tests recorded and fully tested using VCR gem: fast tests (first HTTP request is real and it's response is stored for future runs), deterministic (tests will continue to pass, even if you are offline, or API goes down for maintenance) and accurate (responses will contain the same headers and body you get from a real request).

Installation

Install the gem by running:

gem install movie_quotes

or put it in your Gemfile and run bundle install:

gem "movie_quotes", "~> 0.1.3"

1. Usage

To start using the gem, you should get an API Key (free).

Once completed this quick form the API Key will be sent to you by Juan Roldan (juanroldan1989@gmail.com)

Setup the API Key within an initializer:

# movie_quotes_initializer.rb

MovieQuotes.configure do |config|
  config.api_key = "abcd1234"
end

Then create a new filter instance like so:

filter = MovieQuotes.new

and then call api methods, for instance, to fetch well known movie quotes from actors like Al Pacino:

filter.by_actor("al pacino")

or charachters like morpheus:

filter.by_character("morpheus")

or movies like Die Hard and actors like Bruce Willis:

filter.by_movie("die hard").by_actor("bruce willis")

Once applied all the filters you need, make the API call to get the quotes:

filter.results

To see a full list of examples please check the wiki page.

2. Response

The response format is JSON by default. Results are provided as an array of objects with the following structure:

movie_quotes die hard
filter = MovieQuotes.new
filter.by_movie("die hard").by_actor("bruce willis")
filter.results
=> [
  {
    "content": "Yippie-ki-yay, motherfucker!",
    "rating": 5,
    "year": 1988,
    "categories": [
      "Thriller",
      "Crime",
      "Action"
    ],
    "image_large_url": "https://i.ytimg.com/vi/YfpDSNNgYhI/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRlniyMNhCV4h8UF9zn6Lka4s-OTU_j7Br43Kp5OR7eGljOAIpDXKystfQ",
    "movie": {
      "title": "Die Hard",
      "slug": "die-hard"
    },
    "character": {
      "name": "John Mc Clane",
      "slug": "john-mc-clane"
    },
    "actor": {
      "name": "Bruce Willis",
      "slug": "bruce-willis"
    }
  }
]

3. Development

Questions or problems? Please post them on the issue tracker. You can contribute changes by forking the project and submitting a pull request. You can ensure the tests are passing by running bundle and rake.

4. Copyright

Copyright © 2018 Juan Roldan. See LICENSE.txt for further details.

5. Projects

Developers around the world using MovieQuotes API on their projects: