Code Monkey home page Code Monkey logo

movie_quotes's Introduction

MovieQuotes

Gem Version Code Climate Build Status Coverage Status Downloads License

Ruby client for MovieQuotes API

Docs here

Example app

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 ([email protected])

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. Projects

Developers around the world using MovieQuotes API with their projects:

pic @mention area
@djibba22 @djibba22 building some workflows for personal use with the Workflow app on iOS
@snowfrogdev @snowfrogdev developing a non-commercial app about movies
@jargoglesara @jargoglesara developing a Google Assistant action to interact with the API
@GregJacobs82 @GregJacobs82 developing a sort of "quiz" where a player is supposed to guess who said something and I tought that quotes from movies would be much easier for everyone than other random quotes
@eDubrovsky @eDubrovsky practicing API's and gem documentation's in Rails (newbie lvl), and I was searching on rubygems.org when I found yours. Looks straight forward to use :)
@pyremell @pyremell I am IT student and I developing a project for a course. I would love to have an API key for your Movie Quotes app, so I could make small searches, based in the movie name, to retrieve some famous quotes from that movie.
@shmlkv @shmlkv School project, it will display movie info and showtimes in cinemas asweel as quotes from actors
@KaiRichardson @KaiRichardson A JavaScript/React project built as part of the requirements for completion of the Javascript/React course at Code Louisville: https://github.com/brevans25/Vide-Video
@alexandershin @alexandershin Random Quote machine (FreeCodeCamp course project)
@alex-perez @alex-perez The API will be use for a practicing application. An intern will come in my compagny in next week. He will build a simple app using this api
@shadowM8 @shadowM8 I want to generate random quotes to show on a daily basis for my school project
@AsafDavidov @AsafDavidov Movie Trivia Game for the School I am studying at.
@suhanw @suhanw I'm integrating your API with and React.js and Redux framework.
@denisbobovnik @denisbobovnik learning about APIs and making requests with Ruby : )

5. Copyright

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

movie_quotes's People

Contributors

dependabot[bot] avatar juanroldan1989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

movie_quotes's Issues

Incorrect results for year and category from Mashape API

Is searching for quotes by year and category unimplemented for the version of the API on the Mashape Marketplace?

It doesn't matter what year or category I input, it returns the same movie results.

I'm assuming the main version works, so if you could please send me an API key to [email protected]

Request URL:
https://juanroldan1989-moviequotes-v1.p.mashape.com/api/v1/quotes?year=2002

Response Body:

[
  {
    "content": "Oh, no, it wasn't the airplanes. It was Beauty killed the Beast.",
    "year": 1933,
    "categories": [
      "Drama",
      "Action",
      "Adventure"
    ],
    "image_large_url": "https://s-media-cache-ak0.pinimg.com/736x/56/9c/f2/569cf2832aaabbcaa3487f22d335b4d7.jpg",
    "image_thumb_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSI54WEStqtfEBeocTd1umDmBV4T2-u8D4NB_EJ13PUTUdMBuwfJde4sb4",
    "rating": 8,
    "movie": {
      "title": "King Kong",
      "slug": "king-kong"
    },
    "character": {
      "name": "Carl Denham",
      "slug": "carl-denham"
    },
    "actor": {
      "name": "Robert Armstrong",
      "slug": "robert-armstrong"
    }
  },
  {
    "content": "I'm gonna make him an offer he can't refuse.",
    "year": 1972,
    "categories": [
      "Crime",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/fmX2VzsB25s/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRNfr9QAUIVSLH5ZFynapsJQ2bpduUXLnqRngNJt_81GtNMhAuF2YlEIAs",
    "rating": 10,
    "movie": {
      "title": "The Godfather",
      "slug": "the-godfather"
    },
    "character": {
      "name": "Vito Corleone",
      "slug": "vito-corleone"
    },
    "actor": {
      "name": "Marlon Brando",
      "slug": "marlon-brando"
    }
  },
  {
    "content": "E.T. phone home.",
    "year": 1982,
    "categories": [
      "Family",
      "Fantasy",
      "Adventure"
    ],
    "image_large_url": "https://i.ytimg.com/vi/6xZif3WmG7I/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS8x6i0qwmqtliyb-1g8SVF9gk7j0S8SLNexfxcQEGJU4dZRs38UoBM-Ni3",
    "rating": 10,
    "movie": {
      "title": "E.T. The Extra Terrestrial",
      "slug": "e-t-the-extra-terrestrial"
    },
    "character": {
      "name": "E.T.",
      "slug": "e-t"
    },
    "actor": {
      "name": "Pat Welsh",
      "slug": "pat-welsh"
    }
  },
  {
    "content": "A census taker once tried to test me. I ate his liver with some fava beans and a nice Chianti.",
    "year": 1991,
    "categories": [
      "Thriller",
      "Crime",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/M1b2v_Lls3A/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQO6iO860KO8e6Qmuv_ogCKdHXdo5CgWpPioU6CF9g5FSoqbQNoXPccQJo",
    "rating": 10,
    "movie": {
      "title": "The Silence Of The Lambs",
      "slug": "the-silence-of-the-lambs"
    },
    "character": {
      "name": "Dr. Hannibal Lecter",
      "slug": "dr-hannibal-lecter"
    },
    "actor": {
      "name": "Anthony Hopkins",
      "slug": "anthony-hopkins"
    }
  },
  {
    "content": "I am Shiva, the god of death.",
    "year": 2007,
    "categories": [
      "Mystery",
      "Crime",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/6E2z-1Mi6Zo/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQuwSglGZsQheHmGTGNuCNZNtQ_QRjTrFAqcZWuhvHHNKsujmqrCy6QKG8",
    "rating": 8,
    "movie": {
      "title": "Michael Clayton ",
      "slug": "michael-clayton"
    },
    "character": {
      "name": "Arthur Edens",
      "slug": "arthur-edens"
    },
    "actor": {
      "name": "Tom Wilkinson",
      "slug": "tom-wilkinson"
    }
  },
  {
    "content": "You're gonna need a bigger boat.",
    "year": 1975,
    "categories": [
      "Horror",
      "Thriller",
      "Adventure"
    ],
    "image_large_url": "https://i.ytimg.com/vi/2I91DJZKRxs/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS_rMyluhnMM5nw8z-r-GawaYaz5z_Rny3TcaG-5l1XmPs2yTCtBc_6mp0",
    "rating": 1,
    "movie": {
      "title": "Jaws",
      "slug": "jaws"
    },
    "character": {
      "name": "Martin Brody",
      "slug": "martin-brody"
    },
    "actor": {
      "name": "Roy Scheider",
      "slug": "roy-scheider"
    }
  },
  {
    "content": "Here's looking at you, kid.",
    "year": 1942,
    "categories": [
      "Romance",
      "Drama",
      "War"
    ],
    "image_large_url": "https://i.ytimg.com/vi/rEWaqUVac3M/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRZ786HeCKCHBAKqUKzvA6O9jv_zVWiwAE3O-aGN0dNNuRD2MbeJArfTLDN",
    "rating": 1,
    "movie": {
      "title": "Casablanca",
      "slug": "casablanca"
    },
    "character": {
      "name": "Rick Blaine",
      "slug": "rick-blaine"
    },
    "actor": {
      "name": "Humphrey Bogart",
      "slug": "humphrey-bogart"
    }
  },
  {
    "content": "All right, Mr. DeMille, I'm ready for my close-up.",
    "year": 1950,
    "categories": [
      "Fantasy",
      "Drama",
      "Adventure"
    ],
    "image_large_url": "https://i.ytimg.com/vi/zIcC8YJrevQ/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSbmhyi5atH0HVstHpVg0tMTacAksWKl8BEkSqdGkcIIK0MZHQ8Z4TjTQA",
    "rating": 1,
    "movie": {
      "title": "Sunset Boulevard",
      "slug": "sunset-boulevard"
    },
    "character": {
      "name": "Norma Desmond",
      "slug": "norma-desmond"
    },
    "actor": {
      "name": "Gloria Swanson",
      "slug": "gloria-swanson"
    }
  },
  {
    "content": "The stuff that dreams are made of.",
    "year": 1941,
    "categories": [
      "Film-Noir",
      "Crime",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/i8_hGlwau3A/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTS2bFnjWSay1sGMoRfVbdd6SfrLB66voKZj9D3hQlQyL_pd4rI53qO_LXR",
    "rating": 1,
    "movie": {
      "title": "The Maltese Falcon",
      "slug": "the-maltese-falcon"
    },
    "character": {
      "name": "Sam Spade",
      "slug": "sam-spade"
    },
    "actor": {
      "name": "Humphrey Bogart",
      "slug": "humphrey-bogart"
    }
  },
  {
    "content": "Made it, Ma! Top of the world!",
    "year": 1949,
    "categories": [
      "Film-Noir",
      "Crime",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/e9zO57kVr0w/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQOQqj1O5UBlW2wzNmIBd3w9RZ51qekPB3HR3KvR0xKC2q-oJxdYtWFNdU",
    "rating": 1,
    "movie": {
      "title": "White Heat",
      "slug": "white-heat"
    },
    "character": {
      "name": "Arthur Cody Jarrett",
      "slug": "arthur-cody-jarrett"
    },
    "actor": {
      "name": "James Cagney",
      "slug": "james-cagney"
    }
  },
  {
    "content": "Bond. James Bond.",
    "year": 1962,
    "categories": [
      "Crime",
      "Action",
      "Adventure"
    ],
    "image_large_url": "https://i.ytimg.com/vi/0xDj3NRYTU8/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTQFeSRxQ9bjpjVXBj3dJ4OxfO_C35sccDsecBPR_hy0lyh4b8q2rAbgYg",
    "rating": 1,
    "movie": {
      "title": "Dr. No",
      "slug": "dr-no"
    },
    "character": {
      "name": "James Bond",
      "slug": "james-bond"
    },
    "actor": {
      "name": "Sean Connery",
      "slug": "sean-connery"
    }
  },
  {
    "content": "I am big! It's the pictures that got small.",
    "year": 1950,
    "categories": [
      "Fantasy",
      "Drama",
      "Adventure"
    ],
    "image_large_url": "https://i.ytimg.com/vi/BlQ8VIQ_IRM/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQHfOEQRBxAuQ539fdqUtGwhU3KkpoVj08Gqu6_zOAuzttz817koQR2A_Xn",
    "rating": 1,
    "movie": {
      "title": "Sunset Boulevard",
      "slug": "sunset-boulevard"
    },
    "character": {
      "name": "Norma Desmond",
      "slug": "norma-desmond"
    },
    "actor": {
      "name": "Gloria Swanson",
      "slug": "gloria-swanson"
    }
  },
  {
    "content": "Why don't you come up sometime and see me?",
    "year": 1933,
    "categories": [
      "Comedy",
      "History",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/9B69HtZZc0s/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcST9CZZJiTJoUn3JAAS3-hpUXksIfbPehslBRywc2nBHLVZHxUOQMnsKl8",
    "rating": 1,
    "movie": {
      "title": "She Done Him Wrong",
      "slug": "she-done-him-wrong"
    },
    "character": {
      "name": "Lady Lou",
      "slug": "lady-lou"
    },
    "actor": {
      "name": "Mae West",
      "slug": "mae-west"
    }
  },
  {
    "content": "Play it, Sam. Play 'As Time Goes By.'",
    "year": 1942,
    "categories": [
      "Romance",
      "Drama",
      "War"
    ],
    "image_large_url": "https://i.ytimg.com/vi/Do2olZ49M54/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEFlhYq2lOlVweLl8tN6TQcNUdPkDR0v4EMnpcVTqiy110U-Ky82dNbQ8",
    "rating": 1,
    "movie": {
      "title": "Casablanca",
      "slug": "casablanca"
    },
    "character": {
      "name": "Ilsa Lund",
      "slug": "ilsa-lund"
    },
    "actor": {
      "name": "Ingrid Bergman",
      "slug": "ingrid-bergman"
    }
  },
  {
    "content": "I want to be alone.",
    "year": 1932,
    "categories": [
      "Romance",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/_3H7sgjtvq0/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcT1yYPKbUCEF7rMq1FEuc2zhmMf5vUhLfTQhvkLuGLHtE435hinCtfPJkE",
    "rating": 1,
    "movie": {
      "title": "Grand Hotel",
      "slug": "grand-hotel"
    },
    "character": {
      "name": "Grusinskaya",
      "slug": "grusinskaya"
    },
    "actor": {
      "name": "Greta Garbo",
      "slug": "greta-garbo"
    }
  },
  {
    "content": "Round up the usual suspects.",
    "year": 1942,
    "categories": [
      "Romance",
      "Drama",
      "War"
    ],
    "image_large_url": "https://i.ytimg.com/vi/vtSmfws0_To/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcS2BuQJ1GdtoK2Y75fkHoeDb6eVPgQ7D01a33UQuJ-P2bUYaj9EwWWkWPvP",
    "rating": 1,
    "movie": {
      "title": "Casablanca",
      "slug": "casablanca"
    },
    "character": {
      "name": "Capt. Louis Renault",
      "slug": "capt-louis-renault"
    },
    "actor": {
      "name": "Claude Rains",
      "slug": "claude-rains"
    }
  },
  {
    "content": "Toto, I've got a feeling we're not in Kansas anymore.",
    "year": 1939,
    "categories": [
      "Fantasy",
      "Drama",
      "Adventure"
    ],
    "image_large_url": "https://i.ytimg.com/vi/vQLNS3HWfCM/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwx5uknmPjXcb4nWQZNxIzzU3Cis7Qh2awo92RV_v7qYITFTrvseIpG2vS",
    "rating": 7,
    "movie": {
      "title": "The Wizard Of Oz",
      "slug": "the-wizard-of-oz"
    },
    "character": {
      "name": "Dorothy Gale",
      "slug": "dorothy-gale"
    },
    "actor": {
      "name": "Judy Garland",
      "slug": "judy-garland"
    }
  },
  {
    "content": "Here's Johnny!",
    "year": 1980,
    "categories": [
      "Horror",
      "Mystery"
    ],
    "image_large_url": "https://i.ytimg.com/vi/d-ABIIZV3vA/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTfBPqGmbwVE-XtTVRZqNz-HJ07AqNxs8wDu6KPzeEwUsQVoUVF2Mqd3O7g",
    "rating": 9,
    "movie": {
      "title": "The Shining",
      "slug": "the-shining"
    },
    "character": {
      "name": "Jack Torrance",
      "slug": "jack-torrance"
    },
    "actor": {
      "name": "Jack Nicholson",
      "slug": "jack-nicholson"
    }
  },
  {
    "content": "I see dead people.",
    "year": 1999,
    "categories": [
      "Thriller",
      "Mystery",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/ZSNyiSetZ8Y/hqdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRWADcWqKHvX8HKSY-dwbADMPG4egRCKZUwpoqo-Za--l9KLZiowAZG7wQK",
    "rating": 10,
    "movie": {
      "title": "The Sixth Sense",
      "slug": "the-sixth-sense"
    },
    "character": {
      "name": "Cole Sear",
      "slug": "cole-sear"
    },
    "actor": {
      "name": "Haley Joel Osment",
      "slug": "haley-joel-osment"
    }
  },
  {
    "content": "There's no crying in baseball!",
    "year": 1992,
    "categories": [
      "Sport",
      "Comedy",
      "Drama"
    ],
    "image_large_url": "https://i.ytimg.com/vi/6M8szlSa-8o/maxresdefault.jpg",
    "image_thumb_url": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTQPiLqoDyvpUJyiVcVJc-430S591kjFjq9pPUQKcPxqVG4yCIPOW6UkPrx",
    "rating": 5,
    "movie": {
      "title": "A League Of Their Own",
      "slug": "a-league-of-their-own"
    },
    "character": {
      "name": "Jimmy Dugan",
      "slug": "jimmy-dugan"
    },
    "actor": {
      "name": "Tom Hanks",
      "slug": "tom-hanks"
    }
  }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.