1.0.1 • Published 8 years ago

harrypotter v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

harrypotter_nodejs

Package utilizes @andyrewlee's harry potter api. Link to his project can be found HERE.

Installation

  npm install harrypotter

Usage

Initialization

  var hp = require('harrypotter');
  var client = new hp();

Callback: This callback function requires two arguments, error and data. If the request fails, the error will be an Error object. Otherwise, the data argument will contain the JSON that is returned by the API.

Gets a list of movies:

  client.getAllMovies(callback);

Gets basic/detailed info for specified movie:

  client.getMovieDetails(movieID, dispEmp, callback);

Arguments:

  • movieID: string ID of movie
  • dispEmp: boolean If true, getMovieDetails() provides detailed info pertaining to movie (i.e. employees of hogwarts).

Gets a list of hogwart employees:

  client.getEmployees(callback);

Gets basic/detailed info for specified employee:

  client.getEmployeeInfo(empID, dispDetailed, callback);

Arguments:

  • empID: string ID of employee
  • dispDetailed: boolean If true, getEmployeeInfo() provides detailed info pertaining to employee (i.e. all of the movies they appeared in)