Git Product home page Git Product logo

popular-movie-quotes's Introduction

GitHub license NPM MODULE NPM MODULE NPM MODULE NPM MODULE NPM MODULE NPM MODULE npm GitHub last commit Maintenance Mergify Status Travis (.com)

A simple NPM package to get popular movie quotes.

Getting started

NPM

$ npm i popular-movie-quotes --save

Installation

NPM INSTALL NODE JS NODE JS

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

Installation is done using the npm install command:

$ npm i popular-movie-quotes --save

Usage

usage

  • getAll() method returns an array of objects, each containing quote and movie.
{
  "quote": "Frankly, my dear, I don't give a damn.",
  "movie": "Gone with the Wind",
  "type": "movie",
  "year": 1939
}
  • getQuoteByYear(startYear, endYear) method returns a sorted object within the range of year startYear -endYear**
[
    {
        "quote": "Frankly, my dear, I don't give a damn.",
        "movie": "Gone with the Wind",
        "type": "movie",
        "year": startYear
    }
    ....
    .....
    {
        "quote": "Frankly, my dear, I don't give a damn.",
        "movie": "Gone with the Wind",
        "type": "movie",
        "year": endYear
    }
]
  • getSomeRandom(count) method returns an array (of length 'count') of non-duplicate random objects containing quote and movie.
[
  {
    "quote": "Frankly, my dear, I don't give a damn.",
    "movie": "Gone with the Wind",
    "type": "movie",
    "year": 1939
  }
  // with 'count' number of quote objects.
]
  • getRandomQuote() method returns a random movie quote :
I used to think that my life was a tragedy. But now I realize, it’s a comedy.
  • getQuotesByMovie("MovieName") method returns an array with all quotes of MovieName movie, else returns empty.
[
  {
    "quote": "Frankly, my dear, I don't give a damn.",
    "movie": "Gone with the Wind",
    "type": "movie",
    "year": 1939
  }
]
  • getQuotesByType("movie/anime/tv") method returns an array with all quotes of type movie/anime/tv, else returns empty.
[
   {
        "quote": "Frankly, my dear, I don't give a damn.",
        "movie": "Gone with the Wind",
        "type": "movie",
        "year": 1939
    }
    ....
    .....
    {
        "quote": "You all love twisting the knife into one another.",
        "movie": "Knives Out",
        "type": "movie",
        "year": 2019
  }
]
const movieQuote = require("popular-movie-quotes");

console.log(movieQuote.getAll()); //returns an object with all available quotes.

console.log(movieQuote.getSomeRandom(10)); // returns an object of 10 random quotes.

console.log(movieQuote.getRandomQuote()); // returns a random quote

console.log(movieQuote.getQuoteByYear(2000, 2019)); // returns a sorted object within
// the range of year 2000-2019

console.log(movieQuote.getQuotesByMovie("Joker")); //If present returns and array
// with all quotes of joker movie, else returns empty.

console.log(movieQuote.getQuotesByType("anime")); //If present returns and array
// with all quotes of type anime, else returns empty.

Testing

  • Check if quote is duplicate/already present.
$ npm test

Want to contribute?

Open Source Love forthebadge

Please check issues here!

License

GitHub license

Let's get connected

Twitter Follow GitHub followers Facebook Instagram LinkedIn

Special Thanks

Karan Bhatt Facebook Instagram GitHub followers

Rishabh Kanojia Facebook Instagram GitHub followers


Like us a lot? Help others know why you like us! Review this package on pkgreview.dev Review us on pkgreview.dev

Support me for a cup of coffee

Hey! Help me out with a cup of coffee!

Buy Me A Coffee


forthebadge forthebadge forthebadge forthebadge

popular-movie-quotes's People

Contributors

afhare avatar akash231997 avatar akshat0109 avatar anselb avatar arihanth007 avatar arthur-justino avatar brianlovega avatar caiohsfar avatar cjthoma1 avatar codemekathy avatar gabrielyong38 avatar iamsbundela avatar itachihyuga avatar joshuiaclan avatar lucasagra avatar lucsfreitas avatar manjeet04 avatar mehtadhiraj avatar mergify[bot] avatar navarroguimaraes avatar nikhil9856 avatar nikhilnamal17 avatar pndyjack avatar reillyhowellkcc avatar rvonhoog avatar sakshi171 avatar shivashmahespalsingh avatar shubhankarb180 avatar uaiviiera avatar williamdoyleequiis 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

popular-movie-quotes's Issues

Add unit test to check if quotes have desired formats.

Add mocha unit tests to check if quotes have desired formats.

{  
      "quote": "String",
      "movie": "String",
      "type": "String",
      "year": Number
}

The test should check if the quote exists and is a type of String, same goes with each attribute with an associated data type.

Fixing the data set

Some of the objects in the data set have missing attributes like 'type'. Need to fix that.

Just asking

Hello, i just wanna know that are you still maintaining this repo by receiving some new quotes?

No destinction between movie or tv quote

There is no property that defines if it is from a movie or TV show

Below are some items from the quotes currently
Proposed Types
tv, movie, anime,

  {
    "quote": "I used to think that my life was a tragedy. But now I realize, it’s a comedy.",
    "title": "Joker",
    "type": "movie",
    "year": 2019
  },
  {
    "quote": "Learn to embrace the fear of feeling about what it's like to contemplate what it is to know true pain. Because when I had nothing and no one - I always had pain.",
    "title": "Naruto Shippuden",
    "type": "anime",
    "year": null
  },

Add tests to check duplicate quotes.

Add tests to check the data to be uniform when the functions are called as some have the year as a property and other quotes have in the title of the movie/show

For instance

{
    "quote": "words here for a quote",
    "title": "that movie we saw one time",
     "year": "1964",
}

Add more movie quotes

Do you know any popular movie quotes?
Add your quote to data.json inside the data/ folder and raise the PR.
Language: Only English

{  
      "quote": "Your new Quote",
      "movie": "movie name",
      "type": "movie/anime/tv",
      "year": 2012
}

Note:

Please avoid the repetition of quotes.
Add your quotes in between. Don't add at the bottom or at the top.
Follow the template.
Do not make any changes in other files.
Add me(@NikhilNamal17 ) as reviewer.
Thanks!

add getSome(count) method

Implement a function which returns an array of quotes with given length.

  • console.log(movieQuote.getSome(10)); // get an array of 10 quotes.
  • console.log(movieQuote.getSomeRandom(10)); // get an array of 10 random quotes.

I will be making a pull request.

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.