Simple, promise based, client for Rotten Tomatoes API.
Using Yarn :
$ yarn add rotten-node
Or npm :
$ npm i --save rotten-node
import RT from 'rotten-node';
var api = new RT({ apiKey: YOUR_API_KEY });
api.movie(12989).infos() // <- promise
.then(result => console.log(result))
.catch(error => console.error('An error occured while getting movie infos : %s', error));
Available methods :
// List movies
api.lists.movies.boxOffice();
api.lists.movies.inTheaters();
api.lists.movies.opening();
api.lists.movies.upcoming();
// List DVDs
api.lists.dvds.topRentals();
api.lists.dvds.currentReleases();
api.lists.dvds.newReleases();
api.lists.dvds.upcoming();
// Movie infos
const movieRequest = api.movie(MOVIE_ID);
movieRequest.infos();
movieRequest.cast();
movieRequest.clips();
movieRequest.reviews();
movieRequest.similar();
movieRequest.alias();
// Search
api.search(words, params, callback = null);
Passing params to queries : (available params)
api.lists.movies.boxOffice({
limit: 16,
country: 'us'
});
Using callback :
api.lists.movies.boxOffice(null, function(error, result) {
// jawad here
});
$ yarn dev
$ yarn build
$ yarn test