0.3.4 • Published 6 years ago

metacritic-scraper v0.3.4

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Metacritic Scraper

npm version

A node package for getting information from the Metacritic website

A bit of information

Note that this package is very much a scraper, and therefore, may stop working as aspected on any design change of the Metacritic website. If this happens, feel free to leave an issue on this repository so I can do something about it, or even better, leave a pull request with a fix.

Also note that this package does not, by any means, exhaust the full list of Metacritic features, for now, it only supports getting information from movies. That being said, I do intend to complete this list eventually, even if it might take a while.

Installing

Run npm install metacritic-scraper to install this package.

Usage

This package mainly works by using the search function and feeding it's results to the other functions. For example, getting critic reviews for the movie Sausage Party works like this:

const metacritic = require('metacritic-scraper')

metacritic.search('sausage party', {category: 'movie'}).on('end', (results) => {
	// this assumes that the movie will be the first result
	metacritic.getProduct(results[0]).on('end', (info) => {
		console.log(info.reviews.critic_reviews)
	})
})

You can handle errors with .on('error').

Reference

search(text, options)

Search the Metacrtic website and return the results

ParamTypeDefaultDescription
textStringText sent to the search query
optionsObject
options.categoryString'all'Category from which to get results. (Can be all, movie, game, album, tv, person, video or company)
options.pageNumber0Page from which to get results

getProduct(search_object)

Get additional information about a product. (Currently only supports movies)

ParamTypeDescription
objectObjectA result returned from the search function