Giter Site home page Giter Site logo

projection's Introduction

Projection

Movie showtimes around the globe.

Build Status Coverage Status

NPM

Installation

npm install projection --save

Example

var projection = require('projection');
var p = projection();

p.findTheaters('Montreal', {}, function(err, theaters) {
  console.log(theaters);
});

p.findMovie('Montreal', 'Mad Max', {}, function(err, movie) {
  console.log(movie);
});

How to use

projection.findTheaters(near, options, callback);

  • near - Either a city or a lat/long. ex.: 'Montreal' or '45.3838,-71.8958'
  • options
    • lang - Select langage (default = 'en')
    • date - Select date (0, 1, 2, etc.) (default = 0 ie. today)
  • callback - Function using the results

Returns an array of theaters (and their showtimes) following this structure:

{  
  name: 'Cineplex Odeon Forum Cinemas',
  address: '2313 Sainte-Catherine Street West, Montreal, QC, Canada',
  phone: '(514) 904-1274',
  note: '',
  movies: [  
    {  
      title: 'Insurgent 3D',
      duration: '1hr 59min',
      rating: 'Rated G',
      genre: 'Action/Adventure/Romance',
      trailer: 'http://www.youtube.com/watch...',
      showtimes:[ '18:00', '20:15' ]
    },
    // Other movies in this theater...
  ]
}

projection.findMovie(near, movie, options, callback);

  • near - Either a city or a lat/long. ex.: 'Montreal' or '45.3838,-71.8958'
  • movie - A movie name. ex.: 'Mad Max'
  • options
    • lang - Select langage (default = 'en')
    • date - Select date (0, 1, 2, etc.) (default = 0 ie. today)
  • callback - Function using the results

Returns the movie and its showtimes in the nearest theaters following this structure:

{  
  title: 'Mad Max: Fury Road',
  desc: 'Haunted by his turbulent past, Mad Max believes[...]',
  director: 'George Miller',
  cast: [ 'Charlize Theron', 'Tom Hardy' ],
  duration: '2hr 0min',
  rating: 'Rated 13+',
  genre: 'Action/Adventure/Scifi/Fantasy',
  trailer: 'http://www.youtube.com/watch[...]',
  theaters: [  
    {  
      name: 'Scotiabank Theatre Montreal',
      address: '977 rue Sainte-Catherine Ouest, Montreal, QC, Canada',
      showtimes: [ '19:50', '22:15' ]
    },
    // Other theaters with this movie...
  ]
}

Features

  • Multi-lang support
  • Caching of repeated calls
  • More to come...

Wanna help?

Any contribution is welcomed!

projection's People

Contributors

alexnault avatar jpgdev avatar

Watchers

James Cloos avatar  avatar

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.